Keep node in running state even after user log-off

杀马特。学长 韩版系。学妹 提交于 2021-02-10 06:56:12

问题


How to keep a node application running in windows even when user logs off? Also how to keep running a node http-server even after user log-off?


回答1:


You have 2 great options. One is as mentioned in comments above Forever.

The other is PM2 which is easy to install and offers an incredible amount of options. I use this in all projects, but I cannot attest to the Windows version as I am on Linux & Ubuntu servers and work on a Mac. You can daemonize your node process, follow logs, cluster it and make sure the process reboots even with a server shutdown (it is a service).



来源:https://stackoverflow.com/questions/42854148/keep-node-in-running-state-even-after-user-log-off

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!