-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 v3 Request: New ideas for routing and mounting #1829
Comments
@ReneWerner87 Can I work on this feature? |
You can work for this feature. Also i have some ideas about mounting and grouping after this feature. If you open a PR, i can add some comments |
Hi @vishjain. Are there any progress? |
Working on it right now. Thanks! |
I'm quite keen to see if this would support my use case as I was surprised it doesn't work in v2. I'm essentially dynamically constructing an additional router in a piece of middleware and then handing off to that router. This is something I've done similar in express for complex dynamic multi-tenanted apps but short of creating it all in a To clarify I'm not talking about utilising e.g. func createSubRouter() *fiber.Router {
r := fiber.New()
r.Get("/", func(c *fiber.Ctx) error {
c.JSON("Dynamic Route")
})
return r
}
func main() {
app := fiber.New()
app.Use(func(c *fiber.Ctx) error {
if someCondition() {
r := createSubRouter()
return r.Handle(c)
}
// Standard flow
return c.Next()
}
} |
I'm going to start implementing router in the next weeks 🚀 |
New Router instead of
Group
,Route
andMount
(should be deprecate)Express Router
Routing
RouterConfig can contain
Mounting (#2022)
Express Mount
fiber.Route() (#2065)
Express Route
The text was updated successfully, but these errors were encountered: