1

I have successfully used nssm to create a node service that runs in the background. I have done this, however, with .js files where you set the path to node.exe, then set the startup directory, then set the .js file you want to run in the arguments. Works great.

I'm trying to get http-server to run in the background, and I can't quite make it happen. The difference is, to run http-server, you don't run node.exe, just the 'http-server' command with a path after it. So, I'm scratching my head as to what I place in nssm for the path, startup directory, and arguments.

I've tried to place http-server "C:\path...etc." into a .bat file and run that with nssm, but when starting the service, I get the "Windows could not start the service on local computer..." error, and the service does not start. I've also tried to convert the .bat to a .exe and run into the same error.

Any help would be greatly appreciated!

Phil
  • 87
  • 6

0 Answers0