How to run node.js app forever when console is closed?

前端 未结 12 643
遇见更好的自我
遇见更好的自我 2020-12-12 09:38

I connect to my remote server via ssh. Then I start my node.js app with Forever. Everything works fine until I close my console window. How to run node.js app FOREVER on my

12条回答
  •  无人及你
    2020-12-12 10:02

    Wow, I just found a very simple solution:

    First, start your process (node app)

    forever dist/index.js
    

    run: ^Z cmd + z.

    Then: bg. Yeah.. bg (background). And pum.. you are out.

    Finish with exitif you are with sshor just close the terminal.

提交回复
热议问题