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
Dmitriy Pleshevskiy e1cbcb7696 feat: add result to getenv functions
BREAKING_CHANGES: get env function returns result instead panic
2020-01-19 17:46:07 +03:00

29 lines
No EOL
439 B
Rust

#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate itconfig;
config! {
ROCKET {
HOST: String => "localhost",
PORT: u16 => 9000,
BASE_URL: String => "/",
}
}
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
fn main() {
cfg::init();
rocket::ignite()
.mount(&cfg::ROCKET::BASE_URL(), routes![index])
.launch();
}