Forever + Nodemon running together

后端 未结 8 1466
刺人心
刺人心 2020-12-07 10:04

Is there any way to have both of this packages running together?

So basically I want to have best from both worlds. Running server automatically (and restarting when

8条回答
  •  感动是毒
    2020-12-07 10:06

    I have not found a way of getting both packages running together. I tried to do @toxa's technique, but when my node.js app threw an exception nodemon would not automatically restart it, instead outputting an error message to the forever log:

    nodemon] app crashed - waiting for file changes before starting...
    

    However, forever has a -w option and the following command is effectively the same as if I'm running nodemon and forever together:

    forever start -w my-app.js
    

    The downside of forever -w versus nodemon: forever does not have a --delay option, so my server gets restarted once for each file that is changed.

提交回复
热议问题