Split router to multiple files? #242
jhjacobs81
started this conversation in
General
Replies: 1 comment
-
Of course you can and you should. A example is here: In fact, router's structure is a tree, you can split any part of it to a new module. Router::new().push(user::root_router())
.push(wiki::root_router()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to split the router into seperate files?
suppose i want to build a social media site of some sorts, which includes a forum, a wiki, a gallery, a marketplace, etc etc. After a while main.rs gets rather big, so i would like to split it up into a module called router, which then has forum.rs, wiki.rs, gallery.rs which then includes the routes for their respective modules.
Is this possible?
Beta Was this translation helpful? Give feedback.
All reactions