From af2523cfeeab69feb23c2fb859f0b7212fbcdd3a Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Sat, 28 May 2022 09:50:06 -0700 Subject: [PATCH] setting GinMode to release by default. Users get confused otherwise. --- webapp/backend/pkg/web/server.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/backend/pkg/web/server.go b/webapp/backend/pkg/web/server.go index 914a102..6e7ae20 100644 --- a/webapp/backend/pkg/web/server.go +++ b/webapp/backend/pkg/web/server.go @@ -13,6 +13,7 @@ import ( "net/http" "os" "path/filepath" + "strings" ) type AppEngine struct { @@ -68,6 +69,11 @@ func (ae *AppEngine) Setup(logger logrus.FieldLogger) *gin.Engine { } func (ae *AppEngine) Start() error { + //set the gin mode + gin.SetMode("release") + if strings.ToLower(ae.Config.GetString("log.level")) == "debug" { + gin.SetMode("debug") + } logger := logrus.New() //set default log level