-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Milestone
Description
Feature Description
Here are some code samples from discord to keep track of our ideas for the new router:
- Chained separated Middleware with routes
Router.Get("/gated", controllers.Gated).Middleware(auth.Middleware)
Router.Middleware(auth.Middleware, func (router *fiber.Router) {
router.Get("/me", AuthControllers.me)
router.Get("/user", controllers.UserIndex)
router.Match([]{"Put", "Patch"}, "/user/:user", controllers.UserUpdate)
}).Name("Authenticated Routes")- Multiple methods in a single call
Router.Match([]{"Put", "Patch"}, "/user/:user", controllers.UserUpdate)
Router.Any("/catchall", controllers.CatchAll)- Grouping makes more sense as Prefix - since that is reuqired https://docs.gofiber.io/guide/grouping
const v1 = Router.Prefix("/v1")- Maybe a group can be a callback
Router.Middleware(middlewares.V1Middleware).Prefix("/v1", func (router *fiber.Router) {
router.Get("/endpoint", v1conrtollers.Endpoint)
})Additional Context (optional)
No response
Code Snippet (optional)
No response
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