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
I would like to see some way to have nested mounting / sub-routers in Rocket.
I am coming from Go and there I normally use chi for my app's server, I love it's modular sub-router implementation and was a bit hampered by it's lack in Rocket when I tried to work on my project.
I've looked over all the other issues that are even remotely related to this and none suggested this before, but if I missed something please let me know!
1. Why you believe this feature is necessary.
It makes developing larger applications easier. As of right now you can only return a vector of routes from another function, this is pretty flat and for any moderately large API will result in having a huge cluster.
2. A convincing use-case for this feature.
Modular router means you can have as many sub-routers as you need instead of clustering a ton of registrations in a single place everything.
3. Why this feature can't or shouldn't exist outside of Rocket.
This change requires modifying how the router operates.
The text was updated successfully, but these errors were encountered:
Adding some kind of guard or handler to multiple routes at once: "Everything under /admin should run this code" or "this set of routes should all include the path and parameter /users/{id}".
Something like this was mentioned in Grouped/named routes feature request #497.
Mounting multiple routes at the same place without writing it on every route: "These routes defined at /users and /pages should be mapped to /admin/users and /admin/pages." This can be done by mount()ing a set of routes under a path, but only one level.
I think option 1 would require some significant changes/additions to Rocket, and 2 could be extended to work in a nested manner by making use of Route::set_uri.
It would be helpful to see some of the code you are writing now and the code you would like to be able to write instead.
I've since opted to switch from Rocket to Gotham since it already has this behavior in form of route delegation, I'll go ahead and close the issue now, but feel free to re-open if necessary.
Feature Request
I would like to see some way to have nested mounting / sub-routers in Rocket.
I am coming from Go and there I normally use chi for my app's server, I love it's modular sub-router implementation and was a bit hampered by it's lack in Rocket when I tried to work on my project.
I've looked over all the other issues that are even remotely related to this and none suggested this before, but if I missed something please let me know!
1. Why you believe this feature is necessary.
It makes developing larger applications easier. As of right now you can only return a vector of routes from another function, this is pretty flat and for any moderately large API will result in having a huge cluster.
2. A convincing use-case for this feature.
Modular router means you can have as many sub-routers as you need instead of clustering a ton of registrations in a single place everything.
3. Why this feature can't or shouldn't exist outside of Rocket.
This change requires modifying how the router operates.
The text was updated successfully, but these errors were encountered: