diff --git a/backend/src/api/server.go b/backend/src/api/server.go index 0554f24..b8be76c 100644 --- a/backend/src/api/server.go +++ b/backend/src/api/server.go @@ -45,7 +45,7 @@ func NewServer(cfg config.Config) *Server { } swaggerHandler := ginSwagger.WrapHandler(swaggerFiles.Handler) - router.GET(openAPIEndpoint, func(c *gin.Context) { + serveSwaggerIndex := func(c *gin.Context) { recorder := httptest.NewRecorder() proxyCtx, _ := gin.CreateTestContext(recorder) proxyCtx.Request = c.Request.Clone(c.Request.Context()) @@ -69,8 +69,17 @@ func NewServer(cfg config.Config) *Server { c.Status(recorder.Code) _, _ = c.Writer.WriteString(body) + } + + router.GET(openAPIEndpoint, serveSwaggerIndex) + router.GET(openAPIEndpoint+"/*any", func(c *gin.Context) { + if c.Param("any") == "/" { + serveSwaggerIndex(c) + return + } + + swaggerHandler(c) }) - router.GET(openAPIEndpoint+"/*any", swaggerHandler) } apiV1 := router.Group("/api/v1") diff --git a/frontend/src/components/AnalyticsView.vue b/frontend/src/components/AnalyticsView.vue index 2158c00..41f47ab 100644 --- a/frontend/src/components/AnalyticsView.vue +++ b/frontend/src/components/AnalyticsView.vue @@ -1,21 +1,24 @@