Does the express application also need to monitor file changes after running on the server side?

if the node service is started with pm2 on the server, and the routing and other files change, does pm2 need to restart the node service as it does locally to take effect?

Mar.01,2021

needs to be restarted, otherwise it will be too dangerous. Will it take effect after you update one of the 10 files in the update code? Reload is less visible in
cluster mode, because it is not necessary to shut down all processes and then open new ones. Of course, the content in memory must be gone (but it should not have affected it anyway). Of course,
can also do hot updates. In essence, the cache of require is removed, and the new module is reloaded next time require , but it is generally not achieved by listening for file changes.


all the code related to your server needs to be restarted. Except for static resource files

  • Nodejs log4js uses PM2 to start not logging

    the log is normal in local mode. After starting with pm2 cluster mode, the log cannot be output. The method of searching on the Internet has been tried all over, but it still doesn t work. version: nodejs:9.0.0 express:4.11 log4js:2.5.3 log conf...

    Mar.28,2021
Menu