Express 4 + pm2 watch not working

前端 未结 1 447
执念已碎
执念已碎 2020-12-04 16:40

I\'m running pm2 with this:

pm2 start bin/www --watch ../

Problem is that when I update app.js in the root folder, it doesn\'t seem to be a

相关标签:
1条回答
  • 2020-12-04 17:40

    Figured out a solution:

    //processes.json:
        {
          "apps" : [{
            "name"        : "someExpress4App",
            "script"      : "bin/www",
            "watch"       : "../",
            "log_date_format"  : "YYYY-MM-DD HH:mm Z",
          }]
        }
    

    Put that on the root of your project, then run your pm2 as so:

    pm2 start processes.json
    
    0 讨论(0)
提交回复
热议问题