diff --git a/router.go b/router.go index ad13ced..a247006 100644 --- a/router.go +++ b/router.go @@ -144,23 +144,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { r.mux.ServeHTTP(w, req) } -// Proxy are request and -func (r *Router) Proxy(w http.ResponseWriter, req *http.Request) { - if r == nil { - panic("mux: method ServeHTTP called on nil") - } - - h, pattern := r.mux.Handler(req) - if pattern == "" { - http.Error(w, "Not Found", http.StatusNotFound) - return - } - - // ensure we run all the middlewares - h = stack(r.middlewares, h) - // serve - h.ServeHTTP(w, req) -} +// TODO: proxy for aws lambda // stack middlewares(http handler) in order they are passed (FIFO) func stack(middlewares []func(http.Handler) http.Handler, endpoint http.Handler) http.Handler {