4
Every time I try to make some modification in my file app.js
I have to close and start the server for the modifications to take effect, would there be any way to automatically restart after a change? as in php.
Example:
var http = require('http');
var server = http.createServer(function(request, response){
response.writeHead(200, {"Content-Type": "text/html"});
response.write("<h1>Hello World!</h1>"); // <-- se mudar o texto no F5 não atualiza.
response.end();
});
var servidorLigou = function () {
console.log('Servidor Hello World rodando!');
};
server.listen(3000,servidorLigou);
Oops, that was it. so I should use the
forever
in production and the developing nodemon? do not know why it does not come by default o.O– Gabriel Rodrigues
@Gabrielrodrigues does not come by default because there are more ways to do and are environment-specific and independent solutions (server operating system) in which Node run.
– Sergio