diff --git a/cmd/buz/app.go b/cmd/buz/app.go index d99d061d..12f067a3 100644 --- a/cmd/buz/app.go +++ b/cmd/buz/app.go @@ -108,8 +108,6 @@ func (a *App) initializeManifold() { func (a *App) initializeRouter() { log.Info().Msg("🟢 initializing router") a.engine = gin.New() - a.publicRouterGroup = a.engine.Group("") - a.switchableRouterGroup = a.engine.Group("") if err := a.engine.SetTrustedProxies(nil); err != nil { panic(err) } @@ -147,6 +145,11 @@ func (a *App) initializeMiddleware() { } } +func (a *App) initializeRouterGroups() { + a.publicRouterGroup = a.engine.Group("") + a.switchableRouterGroup = a.engine.Group("") +} + // 🐝 and healthcheck route are always public func (a *App) initializePublicRoutes() { log.Info().Msg("🟢 initializing buz route") @@ -201,6 +204,7 @@ func (a *App) Initialize() { a.initializeRouter() a.initializeManifold() a.initializeMiddleware() + a.initializeRouterGroups() a.initializePublicRoutes() a.initializeOpsRoutes() a.initializeSchemaCacheRoutes()