use comunic_server::controllers::server; use comunic_server::data::config::{conf, Config}; use comunic_server::helpers::{database, movies_helper}; #[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!"); // TODO : remove after application // Remove all movies for movie in movies_helper::get_all().unwrap() { movies_helper::delete(&movie).unwrap(); } // Start the server server::start_server(conf()).await }