This repository has been archived on 2022-07-24. You can view files and clone it, but cannot push or open issues or pull requests.
itconfig/examples/rocket/src/main.rs

29 lines
439 B
Rust
Raw Normal View History

2019-12-31 08:45:50 +03:00
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate itconfig;
config! {
ROCKET {
2020-01-07 17:20:58 +03:00
HOST: String => "localhost",
PORT: u16 => 9000,
2020-01-07 17:20:58 +03:00
BASE_URL: String => "/",
2019-12-31 08:45:50 +03:00
}
}
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
fn main() {
cfg::init();
rocket::ignite()
2019-12-31 08:45:50 +03:00
.mount(&cfg::ROCKET::BASE_URL(), routes![index])
.launch();
}