2020-05-23 07:37:21 +00:00
|
|
|
use comunic_server::controllers::server;
|
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-22 06:51:15 +00:00
|
|
|
|
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
|
|
|
}
|