feat: add download savepoint route

This commit is contained in:
2025-01-17 18:34:06 +03:30
parent ef7b16af68
commit c977c8a15d
7 changed files with 159 additions and 71 deletions

View File

@@ -11,6 +11,18 @@ import (
func Init() {
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
// Logic to execute before the next handler
fmt.Printf("Request Method: %s, URL: %s\n", c.Method(), c.OriginalURL())
// Call the next handler in the stack
err := c.Next()
// Logic to execute after the next handler
fmt.Println("Request completed")
return err
})
config := huma.DefaultConfig("Go API", "1.0.0")
config.Servers = []*huma.Server{{}}
config.Components.SecuritySchemes = map[string]*huma.SecurityScheme{
@@ -21,6 +33,12 @@ func Init() {
},
}
api := humaFiber.New(app, config)
api.UseMiddleware(
func(ctx huma.Context, next func(huma.Context)) {
ctx = huma.WithValue(ctx, "humaContext", ctx)
next(ctx)
},
)
initRouter(api)