usher icon indicating copy to clipboard operation
usher copied to clipboard

Investigate support for nested router instances

Open whitfin opened this issue 5 years ago • 0 comments

One feature that other routers seem to like is the ability to plug a new router in as a delegate, rather than just routes themselves.

If I create paths /a, /b and /c on a router, I could attach that router on /numbers on a parent router to create /numbers/a, etc. It's unsure whether this would be re-calculated directly into the tree, or there would be some switch on whether a node is a router or not.

Technically you could build this on the current public API (I think), but it might be nice to support it directly as it allows more module code. You could have a users.rs which exposes all paths on the /user route - rather than always attach this prefix, this file could export a Router which is mounted on /user in a parent router.

whitfin avatar Apr 05 '19 18:04 whitfin