node.js http server as a Windows service

后端 未结 6 771
再見小時候
再見小時候 2021-02-01 21:42

I created a simple http server in Node.js.

I wanted to make it run permanently on my Windows 2008 machine, so that, if the computer reboots, it automatically restarts.

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 22:08

    You could try the package qckwinsvc. First install it globally:

    npm install -g qckwinsvc

    And then from the cmd:

    qckwinsvc
    prompt: Service name: [...]
    prompt: Service description: [...]
    prompt: Node script path: [/path/to/.js file]
    

    To uninstall:

    qckwinsvc --uninstall

提交回复
热议问题