Skip to content

qodrorid/godaemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

godaemon

Run golang app as background program

Get it:

go get github.com/qodrorid/godaemon

Example:

package main

import (
	_ "github.com/qodrorid/godaemon"
	"log"
	"net/http"
)

func main() {
	mux := http.NewServeMux()
	mux.HandleFunc("/index", func(rw http.ResponseWriter, req *http.Request) {
		rw.Write([]byte("Assalamu'alaikum, golang!\n"))
	})
	log.Fatalln(http.ListenAndServe(":3030", mux))
}

Run it

./example -d=true
~$ curl http://127.0.0.1:3030/index
Assalamu'alaikum, golang!

Enjoy :)

About

Run golang in background

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages