22 lines
469 B
Rust
22 lines
469 B
Rust
#![feature(proc_macro_hygiene, decl_macro)]
|
|
|
|
use rocket::{get, routes, Rocket};
|
|
use rocket_contrib::serve::StaticFiles;
|
|
|
|
#[get("/")]
|
|
fn index() -> &'static str {
|
|
"Hello, world!"
|
|
}
|
|
|
|
fn rocket() -> Rocket {
|
|
let static_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/static");
|
|
let static_files = StaticFiles::from(static_dir);
|
|
rocket::ignite()
|
|
.mount("/", routes![index])
|
|
.mount("/static", static_files)
|
|
}
|
|
|
|
fn main() {
|
|
rocket().launch();
|
|
}
|