summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--debian/rhrdtime.service1
-rw-r--r--src/helsinki.at/rhrdtime/rhrdtime.go14
3 files changed, 3 insertions, 13 deletions
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)
}