gotta set the dumb ass release mode before

This commit is contained in:
Michael Zhang 2020-10-14 14:11:07 -05:00
parent e6d4abf292
commit 2641a40f71
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B

View file

@ -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,