I am using http-server to host one of my local folders:
http-server ./
As you can see I downloaded nssm.exe. I am wondering how I can make this http-server command as service so I can permanently host this folder even when computer restarts? One of the suggestions I found is to use nssm but I am not sure how I can do it. I type this in my cmd:
nssm install httpserver
and then get:
now how to start the http-server ./ command ? Where I should type it and how?
Also if there is easier way to do it without nssm I am open to see it.
I tried it by taking the following steps:
Creating a batch file(script.bat) in the directory with the command:
http-server .
Adding npm bin directory to environment variable for the binaries to be available from the command prompt.
Starting nssm.exe with the following command:
nssm.ext install service_name
In the Path, providing the path to the batch file created in step 1.
In the I/O section, providing the paths to stdin, stdout and stderr to check on the output.
Click Install service.
Start the service.