diff --git a/wax/main.go b/wax/main.go index 1b894c68c..cc18432db 100644 --- a/wax/main.go +++ b/wax/main.go @@ -44,10 +44,6 @@ func DefineAPI(router *gin.Engine) { corsConf.AllowMethods = configuration.Config.Cors.Methods router.Use(cors.New(corsConf)) - // init Database - db := database.Init() - defer db.Close() - health := router.Group("/health") health.GET("/check", methods.HealthCheck) @@ -94,6 +90,10 @@ func main() { flag.Parse() configuration.Init(ConfigFilePtr) + // init Database + db := database.Init() + defer db.Close() + // init routers router := gin.Default()