From 496f05ca42a1021d26741c17607f5f7a813f4a2f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 15 Sep 2015 19:46:47 +0200 Subject: got rid of martini diff --git a/Makefile b/Makefile index 566972e..d4f1b38 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,6 @@ GOCMD := go getlibs: export GOPATH=$(curdir) getlibs: - $(GOCMD) get "github.com/go-martini/martini" $(GOCMD) get "github.com/gorilla/websocket" vet: export GOPATH=$(curdir) diff --git a/debian/rhrdtime.service b/debian/rhrdtime.service index bfffdee..0d4658e 100644 --- a/debian/rhrdtime.service +++ b/debian/rhrdtime.service @@ -4,7 +4,6 @@ Description=Radio Helsinki Rivendell Time Websocket Server [Service] User=rhrdtime Group=rhrdtime -Environment="MARTINI_ENV=production" ExecStart=/usr/bin/rhrdtime Restart=always RestartSec=1s diff --git a/src/helsinki.at/rhrdtime/rhrdtime.go b/src/helsinki.at/rhrdtime/rhrdtime.go index 5fa72a1..ca4d4a7 100644 --- a/src/helsinki.at/rhrdtime/rhrdtime.go +++ b/src/helsinki.at/rhrdtime/rhrdtime.go @@ -31,7 +31,6 @@ import ( "net/http" "time" - "github.com/go-martini/martini" "github.com/gorilla/websocket" ) @@ -105,15 +104,6 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { } } -func RunMartini(addr string) { - m := martini.Classic() - m.Get("/ntp", func(w http.ResponseWriter, r *http.Request) { - handleNTPClient(w, r) - }) - - m.RunOnAddr(addr) -} - func main() { addr_s := flag.String("addr", ":3000", "addr:port to listen on, default: ':3000'") help := flag.Bool("help", false, "show usage") @@ -124,5 +114,7 @@ func main() { return } - RunMartini(*addr_s) + http.HandleFunc("/ntp", handleNTPClient) + + http.ListenAndServe(*addr_s, nil) } -- cgit v0.10.2