Rocket: Use fairings for routes of sub-files
Instead of adding all routes manually in the Launch function for Rocket, implement fairings for all the different files that adds the routing to the rocket in a self-contained manner.
This commit is contained in:
parent
120472354c
commit
222acbb4f8
6 changed files with 28 additions and 10 deletions
|
@ -210,3 +210,9 @@ pub async fn create_week(week: u8, mut db: Connection<Db>, cookies: &CookieJar<'
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stage() -> AdHoc {
|
||||
AdHoc::on_ignite("Week stage", |rocket| async {
|
||||
rocket.mount("/", routes![week, create_week, update_week, set_last_week])
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue