refactor: Switch to pdf subpath

This commit is contained in:
2024-12-12 16:28:06 +01:00
parent 28de60d375
commit 8f676f08a9
4 changed files with 17 additions and 14 deletions

19
main.go
View File

@@ -84,19 +84,22 @@ func main() {
// Swagger documentation route
app.Get("/swagger/*", swagger.HandlerDefault)
// @Security ApiKeyAuth
v1 := app.Group("/v1")
v1.Use(keyauth.New(keyauth.Config{
// @Security ApiKeyAuth
pdfv1 := v1.Group("/pdfs")
pdfv1.Use(keyauth.New(keyauth.Config{
KeyLookup: "query:key",
Validator: validateAPIKey,
}))
v1.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!")
})
v1.Post("/contracts", handler.GenerateContract)
v1.Post("/cards", handler.GenerateCard)
v1.Post("/certificates", handler.GenerateCertificate)
pdfv1.Post("/contracts", handler.GenerateContract)
pdfv1.Post("/cards", handler.GenerateCard)
pdfv1.Post("/certificates", handler.GenerateCertificate)
barcodev1 := v1.Group("/barcodes")
barcodev1.Get("/:type/:content", handler.GenerateBarcode)
app.Use(handler.NotFoundHandler)
docs.SwaggerInfo.BasePath = "/"