1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-29 16:56:28 +00:00
comunicapiv3/src/main.rs

17 lines
470 B
Rust
Raw Normal View History

2020-05-20 17:05:59 +00:00
use comunic_server::data::config::{conf, Config};
2020-05-21 07:21:58 +00:00
use comunic_server::helpers::database;
2020-05-21 13:28:07 +00:00
use comunic_server::controllers::server;
2020-05-21 07:38:41 +00:00
2020-05-21 13:28:07 +00:00
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
2020-05-20 17:05:59 +00:00
// Load configuration
Config::load("config.yaml").expect("Could not load configuration!");
2020-05-21 07:21:58 +00:00
// Connect to the database
database::connect(&conf().database).expect("Could not connect to database!");
2020-05-20 17:05:59 +00:00
2020-05-21 13:28:07 +00:00
// Start the server
server::start_server(conf()).await
2020-05-20 15:46:05 +00:00
}