Was a newbie to node.js, whenever I make a change in the code, In the terminal i used to keep on hitting Ctrl+C and then Up Arrow and restart the server.
After few days, found out nodemon, basically nodemon monitors any code changes in your node app and it automatically restarts the server.
Steps to use nodemon in any node app
npm install -g nodemon
and
nodemon ./server.js localhost 3000
the port number is optional and app specific, if the application accepted a host and port as the arguments, then itβs yours.
nodemon also supports running and monitoring coffee-script apps
nodemon server.coffee
NOTE: If no script is given, nodemon will look for the package.json file and if exists, the nodemon will run the file associated with the main property.