summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--src/helsinki.at/rhimportd/rhimportd.go21
2 files changed, 10 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 244e107..a33f9d7 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ GOCMD := go
getlibs: export GOPATH=$(curdir)
getlibs:
- $(GOCMD) get "github.com/go-martini/martini"
+# $(GOCMD) get "github.com/gorilla/websocket"
vet: export GOPATH=$(curdir)
vet:
diff --git a/src/helsinki.at/rhimportd/rhimportd.go b/src/helsinki.at/rhimportd/rhimportd.go
index c9f3a0f..01092ef 100644
--- a/src/helsinki.at/rhimportd/rhimportd.go
+++ b/src/helsinki.at/rhimportd/rhimportd.go
@@ -26,19 +26,12 @@ package main
import (
"flag"
-
- "github.com/go-martini/martini"
+ "fmt"
+ "html"
+ "net/http"
+ _ "net/http/pprof"
)
-func RunMartini(addr string) {
- m := martini.Classic()
- m.Get("/", func() string {
- return "Hello world!"
- })
-
- m.RunOnAddr(addr)
-}
-
func main() {
addr_s := flag.String("addr", ":4000", "addr:port to listen on, default: ':4000'")
help := flag.Bool("help", false, "show usage")
@@ -49,5 +42,9 @@ func main() {
return
}
- RunMartini(*addr_s)
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
+ })
+
+ http.ListenAndServe(*addr_s, nil)
}