Split up setting up Rocket into a separate function
This commit is contained in:
parent
28175f6639
commit
1a6b577854
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue