Split up setting up Rocket into a separate function

This commit is contained in:
Paul van Tilburg 2017-12-06 15:38:07 +01:00
parent 28175f6639
commit 1a6b577854
1 changed files with 7 additions and 2 deletions

View File

@ -3,6 +3,8 @@
extern crate rocket;
use rocket::Rocket;
mod static_files;
#[get("/")]
@ -10,8 +12,11 @@ fn index() -> &'static str {
"Hello, world!"
}
fn main() {
fn rocket() -> Rocket {
rocket::ignite()
.mount("/", routes![index, static_files::all])
.launch();
}
fn main() {
rocket().launch();
}