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.rs

22 lines
352 B
Rust

#[macro_use]
extern crate rocket;
itconfig::config! {
rocket {
HOST: String => "localhost",
PORT: u16 => 9000,
BASE_URL => "/",
}
}
#[get("/")]
fn hello() -> &'static str {
"Hello, world!"
}
#[launch]
fn rocket() -> _ {
config::init();
rocket::build().mount(config::rocket::BASE_URL(), routes![hello])
}