With Express.js, I'am sending a html file containing a React component within.
app.get('/index', function(req, res) {
res.sendFile(path.join(__dirname + '/src/index.html'));
});
For the purposes, let's assume I want to send a unique variable with my html file to every user connecting to localhost:80/index.
How can I send the vatiable from the server-side and how can I retrieve it from the client side ?
via Mit
No comments:
Post a Comment