From bf7064f9920e88b05bb6ce68838876fac8d426b7 Mon Sep 17 00:00:00 2001 From: hupeh Date: Tue, 3 Jan 2023 02:16:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E8=B7=AF=E7=94=B1=E5=BF=85?= =?UTF-8?q?=E9=A1=BB=E5=9C=A8=E4=B8=AD=E9=97=B4=E4=BB=B6=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index f69205d..a8e87eb 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( ) func main() { - app.ConfigLogger("debug.log", app.LogWhenMinute) + app.ConfigLogger("./tmp/debug.log", app.LogWhenMinute) app.ConfigGormDB() r := chi.NewRouter() @@ -38,9 +38,6 @@ func main() { // Please see _example/main.go for other more, or read the library code. r.Use(httprate.LimitByIP(100, 1*time.Minute)) - // mounting net/http/pprof - r.Mount("/debug", middleware.Profiler()) - // 允许跨域 // see: https://developer.github.com/v3/#cross-origin-resource-sharing r.Use(cors.Handler(cors.Options{ @@ -54,6 +51,9 @@ func main() { MaxAge: 300, // Maximum value not ignored by any of major browsers })) + // mounting net/http/pprof + r.Mount("/debug", middleware.Profiler()) + app.RegisterRoutes(r) if err := http.ListenAndServe(":3000", r); err != nil {