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

前端 未结 12 627
遇见更好的自我
遇见更好的自我 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:06

    This is only a partial answer for Windows. I’ve created a single line Visual Basic Script called app.vbs that will start your node application within a hidden window:

    CreateObject("Wscript.Shell").Run "node app.js", 0
    

    To execute it automatically at startup, open the %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\ directory and add a shortcut to the app.vbs file.

    More info at: https://keestalkstech.com/2016/07/start-nodejs-app-windowless-windows/

提交回复
热议问题