-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Milestone
Description
Feature Description
- V2 Grouping should be renamed Prefixing - and solely the ability to define a prefix, not actual grouping
- Grouping should work somewhat how V2 Grouping works, but does not require a prefix
ex: defining a group
authRoutes := app.Group(middleware.Auth)
authRoutes.Get("/me", controllers.AuthMe)ex: defining a group with a prefix
authRoutes := app.Group(middleware.Auth).Prefix("/auth")
authRoutes.Get("/me", controllers.AuthMe)- CHANGE: Grouped middleware should be given the context of each individual route, not the groups route
package middleware
func Auth(c *fiber.Ctx) {
c.Route() // should be /auth/me - NOT /auth (currently in v2)
}Other Notes
- v2 grouping currently adds routes, a GET for each group - this is not neccessary
- All middleware in groups should only executed w/ the exact context of the routes defined w/in the group
other ideas of grouping
app.Prefix("/auth").Group(middleware.Auth, func(app *fiber.App) {
app.Get("/me", controllers.AuthMe)
})I like the 1st example more - just more ideas
Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have checked for existing issues that describe my suggestion prior to opening this one.
- I understand that improperly formatted feature requests may be closed without explanation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done