Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/partials/routing/handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ app.Post("/api/register", func(c fiber.Ctx) error {
})
```

# Use
## Use

Can be used for middleware packages and prefix catchers. Prefixes now require either an exact match or a slash boundary, so `/john` matches `/john` and `/john/doe` but not `/johnnnnn`. Parameter tokens like `:name`, `:name?`, `*`, and `+` are still expanded before the boundary check runs.

Expand Down
6 changes: 3 additions & 3 deletions docs/whats_new.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ import (
)

type CustomCtx struct {
fiber.Ctx
fiber.DefaultCtx
}

func (c *CustomCtx) CustomMethod() string {
return "custom value"
}

func main() {
app := fiber.NewWithCustomCtx(func(app *fiber.App) fiber.Ctx {
app := fiber.NewWithCustomCtx(func(app *fiber.App) fiber.CustomCtx {
return &CustomCtx{
Ctx: *fiber.NewCtx(app),
DefaultCtx: *fiber.NewDefaultCtx(app),
}
})
Comment thread
gaby marked this conversation as resolved.

Expand Down