How does one start a node.js server as a daemon process?

后端 未结 8 1511
余生分开走
余生分开走 2020-11-30 17:41

In Python Twisted, you have the twistd command that helps you with a number of things related to running your application (daemonize it for example).

Ho

8条回答
  •  北海茫月
    2020-11-30 18:07

    You can try:

    $ nohup node server.js &
    

    It work for me on Mac and Linux.

    The output will be in the ./nohup.out file

    But I still recommend you use pm2 or forever, because they are easily used for restarting, stopping and logging.

提交回复
热议问题