1
0
Fork 0

Display config

This commit is contained in:
Alex Kotov 2020-10-15 08:53:31 +05:00
parent 0e41f6a853
commit 14e87216bc
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 3 additions and 0 deletions

View file

@ -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,

View file

@ -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();
} }