Using Nodemon

Nodemon is a command-line tool that helps with the speedy development of Node.js applications. It monitors your project directory and automatically restarts your node application when it detects any changes.

This means that you do not have to stop and restart your applications in order for your changes to take effect. You can simply write code, and test your application a few seconds later.

To install nodemon locally, we can run the following in the Terminal::

npm install -g nodemon

Nodemon serves as a replacement for node, and does not require any code changes within your application. Once it has installed, we can start our application with auto-restart, using the following command:

nodemon index.js

You can also try to run the following command:

PORT=1234 nodemon index.js

Now, after making a change to any file in your project directory, nodemon will automatically restart your server, and you will get to see the changes in effect.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.243.184