nodemon can help us frequently modify the code to restart the server. nodemon is a third-party command line tool developed based on Node.js, it needs to be installed separately when using it
npm install --global nodemon
use
# 使用方式和node一样
nodemon practice.js
# 等价于
node practice.js
nodemon will automatically monitor whether the code of the current project is modified, and automatically restart the service