diff --git a/cmd/api/handlers/config.go b/cmd/api/handlers/config.go index 11840cf1c..2dc21bdc2 100644 --- a/cmd/api/handlers/config.go +++ b/cmd/api/handlers/config.go @@ -10,7 +10,8 @@ import ( // GetConfig - func GetConfig() gin.HandlerFunc { return func(c *gin.Context) { - ctx := c.MustGet("context").(*config.Context) + ctxs := c.MustGet("contexts").(config.Contexts) + ctx := ctxs.Any() tzktEndpoints := make(map[string]string) for network, tzkt := range ctx.Config.TzKT { diff --git a/cmd/api/main.go b/cmd/api/main.go index 7924a84f7..fab04dbf9 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -87,7 +87,7 @@ func (api *app) makeRouter() { v1 := r.Group("v1") { v1.GET("swagger.json", handlers.MainnetMiddleware(api.Contexts), handlers.GetSwaggerDoc()) - v1.GET("config", handlers.MainnetMiddleware(api.Contexts), handlers.GetConfig()) + v1.GET("config", handlers.ContextsMiddleware(api.Contexts), handlers.GetConfig()) v1.GET("head", handlers.ContextsMiddleware(api.Contexts), cache.CachePage(store, time.Second*10, handlers.GetHead())) v1.GET("head/:network", handlers.NetworkMiddleware(api.Contexts), cache.CachePage(store, time.Second*10, handlers.GetHeadByNetwork()))