diff options
Diffstat (limited to 'src/helsinki.at/rhimportd/rhimportd.go')
-rw-r--r-- | src/helsinki.at/rhimportd/rhimportd.go | 21 |
1 files changed, 9 insertions, 12 deletions
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) } |