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

24 lines
397 B
Rust

#![feature(proc_macro_hygiene, decl_macro)]
#[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])
}