|
|
@ -76,17 +76,9 @@ func getHandler(headers []string) (http.Handler, *Server) {
|
|
|
|
|
|
|
|
|
|
|
|
router := pat.New()
|
|
|
|
router := pat.New()
|
|
|
|
|
|
|
|
|
|
|
|
router.Get("/json", func(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
router.Get("/html", service.handleHTTPAs(htmlResponse))
|
|
|
|
service.handleHTTP(resp, req, jsonResponse)
|
|
|
|
router.Get("/json", service.handleHTTPAs(jsonResponse))
|
|
|
|
})
|
|
|
|
router.Get("/text", service.handleHTTPAs(textResponse))
|
|
|
|
|
|
|
|
|
|
|
|
router.Get("/text", func(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
|
|
|
|
service.handleHTTP(resp, req, textResponse)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
router.Get("/html", func(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
|
|
|
|
service.handleHTTP(resp, req, htmlResponse)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
router.Get("/", func(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
router.Get("/", func(resp http.ResponseWriter, req *http.Request) {
|
|
|
|
if req.URL.Path == "/" {
|
|
|
|
if req.URL.Path == "/" {
|
|
|
|