godaemon

package module
v0.0.0-...-aeac1c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2017 License: MIT Imports: 4 Imported by: 0

README

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 :)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL