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
Right now, all routes and middleware must be set up at the top-level App. However, it's often useful to be able to nest an existing router (or potentially App at a given route inside another App. Similarly, it should be possible to set up middleware at specific nestings within a router, so that it only applies to paths with a specific prefix.
To sketch, this might look something like:
letmut app = App::new(my_data);
app.at("/foo").nest(|router| {
router.middleware(some_middlware);// only applies to routes within this nesting
router.at("bar").get(bar_endpoint);// ultimately routes `/foo/bar` to `bar_endpoint`})
Let's nail down the API design and then work out a good implementation approach.
The text was updated successfully, but these errors were encountered:
Right now, all routes and middleware must be set up at the top-level
App
. However, it's often useful to be able to nest an existing router (or potentiallyApp
at a given route inside anotherApp
. Similarly, it should be possible to set up middleware at specific nestings within a router, so that it only applies to paths with a specific prefix.To sketch, this might look something like:
Let's nail down the API design and then work out a good implementation approach.
The text was updated successfully, but these errors were encountered: