One problem with the simple Express server is that you have to restart the application every time there is a change to the source code to see the changes implemented.

By installing nodemon, you have an “auto-refresh upon source code save” feature.

Step 0: Go to Express project root.

Step 1: Install nodemon

npm install --save-dev nodemon

Step 2: Add the following line: "dev": "nodemon index.js" to package.json

1
2
3
4
5
"scripts": {
  "start": "node index.js",
  "dev": "nodemon index.js",
  "test": "echo \"Error...""
}