diff --git a/route/route.go b/route/route.go index 02a3f57..65f287f 100644 --- a/route/route.go +++ b/route/route.go @@ -17,8 +17,6 @@ import ( // RegisterRoutes load all the enabled routes for the application func RegisterRoutes() *gin.Engine { - router := gin.Default() - if config.GofletCfg.Debug { gin.SetMode(gin.DebugMode) gin.DefaultWriter = os.Stdout @@ -28,6 +26,9 @@ func RegisterRoutes() *gin.Engine { gin.DefaultWriter = io.Discard } + // Router should be created after setting the mode + router := gin.Default() + // Log the requests router.Use(middleware.SafeLogger())