diff --git a/web/web.go b/web/web.go index 0b9040a..5eae125 100644 --- a/web/web.go +++ b/web/web.go @@ -29,15 +29,15 @@ func RunWeb(config *config.Config) { Timeout: 10 * time.Second, } + if !config.Debug { + gin.SetMode(gin.ReleaseMode) + } + r := gin.Default() r.Use(gin.Recovery()) r.Use(static.Serve("/static", static.LocalFile("web/static", false))) r.Use(sessions.Sessions("mysession", sessions.NewCookieStore([]byte(config.Web.SessionSecret)))) - if !config.Debug { - gin.SetMode(gin.ReleaseMode) - } - r.HTMLRender = ginview.New(goview.Config{ Root: "web/templates", DisableCache: config.Debug,