I am running my nodejs app by npm start
npm start
I just installed nodemon by sudo npm install -g nodemon so that i can get my server restarted when i s
sudo npm install -g nodemon
Add following code in your code
app.js
app.listen(3000, function(){ console.log("info",'Server is running at port : ' + 3000); });
package.json
nodemon app.js
Then run npm start from the command line.