2017-01-20 00:31:22 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
2017-01-22 17:48:14 +00:00
|
|
|
|
|
|
|
"github.com/kr/pretty"
|
2017-01-20 00:31:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
port = flag.String("port", "9090", "HTTP port to listen on")
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
http.ListenAndServe(":"+*port, http.HandlerFunc(handle))
|
|
|
|
}
|
|
|
|
|
|
|
|
func handle(w http.ResponseWriter, r *http.Request) {
|
2017-01-20 01:16:40 +00:00
|
|
|
fmt.Fprintln(w, "Route is go!")
|
2017-01-22 17:48:14 +00:00
|
|
|
fmt.Fprintf(w, "%s\n", pretty.Sprint(r.Header))
|
2017-01-20 00:31:22 +00:00
|
|
|
}
|