2019-01-23 14:17:04 +01:00
|
|
|
#![feature(proc_macro_hygiene, decl_macro)]
|
2018-10-08 23:03:19 +02:00
|
|
|
|
2019-01-23 14:17:04 +01:00
|
|
|
#[macro_use] extern crate rocket;
|
2019-01-23 14:53:27 +01:00
|
|
|
#[macro_use] extern crate rocket_contrib;
|
2018-10-08 23:03:19 +02:00
|
|
|
|
2019-01-23 14:53:27 +01:00
|
|
|
use rocket_contrib::serve::StaticFiles;
|
2018-10-08 23:03:19 +02:00
|
|
|
|
2019-01-23 14:17:04 +01:00
|
|
|
fn main() {
|
2019-01-23 14:53:27 +01:00
|
|
|
let myrocket = rocket::ignite().mount("/", StaticFiles::from("static"));
|
|
|
|
let myrocket = myrocket.mount("/api", routes![world]);
|
|
|
|
myrocket.launch();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[get("/")]
|
|
|
|
fn world() -> &'static str {
|
|
|
|
"Hello, world!"
|
2019-01-23 14:17:04 +01:00
|
|
|
}
|