feat(api): Add Swagger UI for v1 endpoints
Serve interactive docs at /api, covering only the current /api/v1/* endpoints. Deprecated /api/diyanet/* endpoints are left undocumented.
This commit is contained in:
1 parent
c3bf3eca8d
commit
cec7f1566e
3 files changed
+193
No files matched your search
@@ -261,6 +261,16 @@ func New(services Services) *fiber.App {
|
||||
return ctx.JSON(mapped)
|
||||
})
|
||||
|
||||
app.Get("/api/openapi.yaml", func(ctx fiber.Ctx) error {
|
||||
ctx.Response().Header.Set(fiber.HeaderContentType, "application/yaml")
|
||||
return ctx.Send(openapiSpec)
|
||||
})
|
||||
|
||||
app.Get("/api", func(ctx fiber.Ctx) error {
|
||||
ctx.Response().Header.Set(fiber.HeaderContentType, fiber.MIMETextHTMLCharsetUTF8)
|
||||
return ctx.SendString(swaggerHTML)
|
||||
})
|
||||
|
||||
app.Use("/", static.New("", static.Config{FS: templates.FS()}))
|
||||
|
||||
return app
|
||||
|
||||
Reference in new issue
Block a user