18 lines
400 B
Rust
18 lines
400 B
Rust
#![feature(proc_macro_hygiene, decl_macro)]
|
|
|
|
#[macro_use] extern crate rocket;
|
|
#[macro_use] extern crate rocket_contrib;
|
|
|
|
use rocket_contrib::serve::StaticFiles;
|
|
|
|
fn main() {
|
|
let myrocket = rocket::ignite().mount("/", StaticFiles::from("static"));
|
|
let myrocket = myrocket.mount("/api", routes![world]);
|
|
myrocket.launch();
|
|
}
|
|
|
|
|
|
#[get("/")]
|
|
fn world() -> &'static str {
|
|
"Hello, world!"
|
|
} |