You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defines routes with a common prefix inside the supplied function. Internally it uses [`Group`](#group) to create a sub-router and accepts an optional name prefix.
Copy file name to clipboardExpand all lines: docs/core/whats_new.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -328,18 +328,17 @@ In `v2` one handler was already mandatory when the route has been registered, bu
328
328
329
329
### Route chaining
330
330
331
-
The route method is now like [`Express`](https://expressjs.com/de/api.html#app.route) which gives you the option of a different notation and allows you to concatenate the route declaration.
331
+
This release introduces a dedicated `RouteChain` helper, inspired by [`Express`](https://expressjs.com/en/api.html#app.route), for declaring a stack of handlers on the same path. The original `Route` helper for prefix encapsulation also remains available.
332
332
333
-
```diff
334
-
- Route(prefix string, fn func(router Router), name ...string) Router
You can find more information about `app.Route` in the [API documentation](./api/app#route).
362
+
You can find more information about `app.RouteChain` and `app.Route` in the API documentation ([RouteChain](./api/app#routechain), [Route](./api/app#route)).
364
363
365
364
### Middleware registration
366
365
367
-
We have aligned our method for middlewares closer to [`Express`](https://expressjs.com/de/api.html#app.use) and now also support the [`Use`](./api/app#use) of multiple prefixes.
366
+
We have aligned our method for middlewares closer to [`Express`](https://expressjs.com/en/api.html#app.use) and now also support the [`Use`](./api/app#use) of multiple prefixes.
368
367
369
368
Prefix matching is now stricter: partial matches must end at a slash boundary (or be an exact match). This keeps `/api` middleware from running on `/apiv1` while still allowing `/api/:version` style patterns that leverage route parameters, optional segments, or wildcards.
In Fiber v3, the `Mount` method has been removed. Instead, you can use the `Use` method to achieve similar functionality.
1655
+
In this release, the `Mount` method has been removed. Instead, you can use the `Use` method to achieve similar functionality.
1657
1656
1658
1657
```go
1659
1658
// Before
@@ -1667,7 +1666,7 @@ app.Use("/api", apiApp)
1667
1666
1668
1667
#### Route Chaining
1669
1668
1670
-
Refer to the [route chaining](#route-chaining) section for details on migrating `Route`.
1669
+
Refer to the [route chaining](#route-chaining) section for details on the new `RouteChain` helper. The `Route` function now matches its v2 behavior for prefix encapsulation.
0 commit comments