From b5b6c1ea0393a96d749551e45f9d1dc644a8e25b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 22 Jul 2020 08:01:59 +0000 Subject: [PATCH] add chi logger middleware to admin --- cmd/telebit/admin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/telebit/admin.go b/cmd/telebit/admin.go index 481d6d5..ad360f1 100644 --- a/cmd/telebit/admin.go +++ b/cmd/telebit/admin.go @@ -19,6 +19,7 @@ import ( "git.rootprojects.org/root/telebit/table" "github.com/go-chi/chi" + "github.com/go-chi/chi/middleware" "github.com/gorilla/websocket" ) @@ -27,6 +28,10 @@ var httpsrv *http.Server func InitAdmin(authURL string) { r := chi.NewRouter() + r.Use(middleware.Logger) + //r.Use(middleware.Timeout(120 * time.Second)) + r.Use(middleware.Recoverer) + r.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { next.ServeHTTP(w, r)