summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-09-15 17:46:47 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-09-15 17:46:47 (GMT)
commit496f05ca42a1021d26741c17607f5f7a813f4a2f (patch)
treedbaaf3f9f95d3856eb2dab082acb694aa7f91cb6
parente7240253ca69291fac636478fd54568467d6c6e2 (diff)
got rid of martini
-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)
}