Is there any way to refresh a Node.js page after a socket.io event ?
var messageDynamic = "Initial status";
app.get("/", function(request, response) {
response.setHeader('Content-Type', 'text/plain');
response.end('The status is : ' + messageDynamic);
});
io.on('connection', function(socket) {
socket.on('UPDATE', function(message) {
messageDynamic = message;
// here I want to refresh the Node.js page (in order to update the message)
});
Would it be possible that once 'messageDynamic' is updated, the node.js page is updated to ?
Any help would be appreciated