Reputation: 137
The Go language provides handlers for serving HTTP responses. It is easy enough to start up a Go program on the command prompt, that listens for incoming HTTP requests.
What are the deployment options for running such a Go program in the background on a Windows Server machine? For example, is there a standard method for creating a Windows Service that runs the Go program in the background?
Upvotes: 12
Views: 7479
Reputation: 969
There is an excellent golang package kardianos/service that will allow you to create a service whatever the platform you are targeting.
As you can see here (it is in french but what is interesting is the code sample at the begginning of the page), it is easy to extend your program with command line options such as :
Upvotes: 14
Reputation: 7876
nssm install MyService d:\MyService.exe
... others ...
Upvotes: 1