1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-02-18 15:02:41 +00:00
comunicapiv3/src/main.rs

18 lines
471 B
Rust
Raw Normal View History

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