How to view and reload ExpressJs application with pm2

I am developing an ExpressJS application. I use pm2 to download it:

myapp$ pm2 start bin/www 

This works fine, except that adding the --watch flag --watch not work; every time I change the source of JS, I need to explicitly restart it for the changes to take effect:

 myapp$ pm2 restart www 

What am I doing wrong? I tried the --watch flag with a non-ExpressJS application and it worked as expected.

+6
source share
1 answer

See this stack overflow solution .

The problem is with the path where pm2 is observing, and if it is relative to the executable or the actual root path of the project.

+5
source

Source: https://habr.com/ru/post/982443/


All Articles