func (s *server) ServerHandler() http.Handler { n := negroni.New() n.Use(negroni.HandlerFunc(s.upstreamMiddleware)) n.Use(negroni.HandlerFunc(s.fixRailsVerbMiddleware)) n.UseHandler(http.HandlerFunc(s.handleRequest)) return n }
func ServerHandler() http.Handler { s := &server{ transport: &http.Transport{ ResponseHeaderTimeout: 15 * time.Second, }, upstream: upstream, logger: log.New(os.Stdout, "[server] ", log.LstdFlags), } n := negroni.New() n.Use(negroni.HandlerFunc(s.upstreamMiddleware)) n.Use(negroni.HandlerFunc(s.fixRailsVerbMiddleware)) n.UseHandler(http.HandlerFunc(s.handleRequest)) return n }