How to automatically reload Node.js project when using pm2

后端 未结 4 1060
情深已故
情深已故 2021-02-02 10:58

I am currently programming Node.js with Express.js, and every time I change a line of code in the file router or app, I need to type the command:

pm2 reload id_         


        
4条回答
  •  终归单人心
    2021-02-02 11:49

    PM2 comes with a handy development tool that allow you to start an application and restart it on file change:

    # Start your application in development mode
    # it print the logs and restart on file change too
    
    # Two way of running your application :
    pm2-dev start my-app.js
    
    # or
    
    pm2-dev my-app.js
    

提交回复
热议问题