Problem Description
How to automatically restart the server created with Node.js after modifying the code?
Solution
Use a third-party tool nodemon
to help us solve the problem frequently modify the code to restart the server
nodemon
It is a third-party command line tool developed based on Node.js, we need to install it separately when we use it
npm install nodemon -g
Global installation- Use to
nodemon -v
view the version of nodemon - After the installation is complete, use
nodemon xxx.js
Start. As long asnodemon xxx.js
the server is started, it will monitor file changes, and when the file changes, it will automatically restart the server.
Further reading
https://blog.csdn.net/weixin_43974265/category_10692693.html