Will there be a way to update a file and see the changes in real time?
example
I have a file
server.js
and I modify it.
How do I make the result look like without stopping the service and restarting it with node server.js
?
Will there be a way to update a file and see the changes in real time?
example
I have a file
server.js
and I modify it.
How do I make the result look like without stopping the service and restarting it with node server.js
?
You can use nodemon, which is a node daemon to run the server, with it every time there are changes it will be updated without having to restart the server, you install it:
then you run it:
and ready.
As Lius Angel has answered you, you can use nodemon, but so that you don't have to execute the command each time in the console, what you can do is include the startup scripts in package.json. I'll explain with an example.
Package.json:
This way every time you save your code, it will be updated. I hope I've been helpful. All the best.
It's a bit late, but I know someone can help. If you want to prevent the server from restarting every time it saves changes made to client-side JS files, you can configure nodemon to ignore those files.
In your package.json file add this: