How do I run a node.js app as a background service?

前端 未结 26 1403
隐瞒了意图╮
隐瞒了意图╮ 2020-11-22 05:28

Since this post has gotten a lot of attention over the years, I\'ve listed the top solutions per platform at the bottom of this post.


Original post

26条回答
  •  Happy的楠姐
    2020-11-22 06:23

    This might not be the accepted way, but I do it with screen, especially while in development because I can bring it back up and fool with it if necessary.

    screen
    node myserver.js
    >>CTRL-A then hit D
    

    The screen will detach and survive you logging off. Then you can get it back back doing screen -r. Hit up the screen manual for more details. You can name the screens and whatnot if you like.

提交回复
热议问题