Display config
This commit is contained in:
parent
0e41f6a853
commit
14e87216bc
2 changed files with 3 additions and 0 deletions
|
@ -10,12 +10,14 @@ const DEFAULT_PORT: u16 = 8000;
|
||||||
const DEFAULT_DATABASE_URL: &str =
|
const DEFAULT_DATABASE_URL: &str =
|
||||||
"postgres://fedihub:fedihub@localhost/fedihub_development";
|
"postgres://fedihub:fedihub@localhost/fedihub_development";
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub enum Environment {
|
pub enum Environment {
|
||||||
Development,
|
Development,
|
||||||
Test,
|
Test,
|
||||||
Production,
|
Production,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub root: String,
|
pub root: String,
|
||||||
pub environment: Environment,
|
pub environment: Environment,
|
||||||
|
|
|
@ -19,5 +19,6 @@ extern crate rocket_contrib;
|
||||||
fn main() {
|
fn main() {
|
||||||
dotenv::dotenv().unwrap();
|
dotenv::dotenv().unwrap();
|
||||||
let config = config::Config::from_env().unwrap();
|
let config = config::Config::from_env().unwrap();
|
||||||
|
println!("Running with {:#?}", config);
|
||||||
web::rocket(config).launch();
|
web::rocket(config).launch();
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue