Feature Description
I was thinking it'd be awesome if the buildTree method in App could be made public. This tweak would open up possibilities for dynamic request handling.
already checked #735 I get that rebuilding the tree might be resource-intensive, but we'd only use it during development. This way, we can ensure our routing behaves as expected without resorting to an * route and redoing all the routing and parsing logic.
Our goal is to enable users to define routes dynamically, with handlers loaded in on-the-fly. So, by simply making the buildTree method public, it'd really help us out.
Additional Context (optional)
The code snippet below illustrates how making buildTree public could streamline fiber routing without the need for using *.
s.app.Get("/define", func(ctx *fiber.Ctx) error {
// load config
path := "/test/:param"
s.app.Get(path, func(ctx *fiber.Ctx) error {
// load the handler instruction
// executing logic written by user
// can access the :param easily
return nil
})
// after each definition
s.app.BuildTree()
return ctx.JSON(map[string]any{
"success": true,
})
})
Code Snippet (optional)
No response
Checklist:
Feature Description
I was thinking it'd be awesome if the
buildTreemethod inAppcould be made public. This tweak would open up possibilities for dynamic request handling.already checked #735 I get that rebuilding the tree might be resource-intensive, but we'd only use it during development. This way, we can ensure our routing behaves as expected without resorting to an
*route and redoing all the routing and parsing logic.Our goal is to enable users to define routes dynamically, with handlers loaded in on-the-fly. So, by simply making the buildTree method public, it'd really help us out.
Additional Context (optional)
The code snippet below illustrates how making
buildTreepublic could streamline fiber routing without the need for using *.Code Snippet (optional)
No response
Checklist: