是否可以使用 context.ClearHandler()作为Negroni的中间件,就像我已经看到它用作Alice的中间件一样?我目前正在收到以下错误:
cannot use context.ClearHandler() (type http.Handler) as type negroni.Handler in argumenthttp.Handler does not implement negroni.Handler
我有一个使用httprouter和negroni的web服务器。用户通过外部OAuth登录本系统。我们将令牌保存到加密会话中,该会话指示它们是否已登录。在negroni自述中,有一个用大猩猩mux做这件事的例子,但我无法完全理解如何用httprouter来做这件事。httprouter.New()router.GET("/", Index) // auth r
//handlers.CombinedLoggingHandler comes from gorilla/handlers negroni.Wrap(handlers.CombinedLoggingHandler(os.Stdout, admin_subrouter)),
admin_subrouter.HandleFunc).Methods("GET")