refactor: Switch to pdf subpath
This commit is contained in:
19
main.go
19
main.go
@@ -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 = "/"
|
||||
|
||||
Reference in New Issue
Block a user