use comunic_server::{cleanup_thread, 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(&conf_file).expect("Could not load configuration!"); // Connect to the database database::connect(&conf().database).expect("Could not connect to database!"); // Start cleanup thread cleanup_thread::start().expect("Failed to start cleanup thread!"); // Start the server server::start_server(conf()).await }