diff --git a/src/main.rs b/src/main.rs index 612f66d..3ad1933 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,12 +2,15 @@ use comunic_server::controllers::server; use comunic_server::data::config::{conf, Config}; use comunic_server::helpers::database; - #[actix_rt::main] async fn main() -> std::io::Result<()> { + let conf_file = match std::env::args().skip(1).next() { + Some(el) => el, + None => "config.yaml".to_string(), + }; // Load configuration - Config::load("config.yaml").expect("Could not load configuration!"); + Config::load(&conf_file).expect("Could not load configuration!"); // Connect to the database database::connect(&conf().database).expect("Could not connect to database!");