Add http package

This commit is contained in:
2016-07-26 23:52:48 +02:00
parent c36016486d
commit a5766e57f8
4 changed files with 123 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
package main
import (
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/localhots/shezmu"
shezttp "github.com/localhots/shezmu/http"
)
func main() {
sv := shezmu.Summon()
server := shezttp.NewServer(sv, ":2255")
server.Get("/", func(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
w.Write([]byte("It works!"))
})
go server.Start()
sv.StartDaemons()
sv.HandleSignals()
}