blob: 7cc694d4a50552051f1ba686b211a3400219267c (
plain)
use actix_web::{web::Data, App, HttpServer};
use exun::RawUnexpected;
mod api;
mod models;
mod services;
use services::*;
#[actix_web::main]
async fn main() -> Result<(), RawUnexpected> {
let sql_pool = db::initialize("password_database", "dbuser", "Demo1234").await?;
HttpServer::new(move || {
App::new()
.app_data(Data::new(sql_pool.clone()))
.service(api::liveops())
.service(api::users())
})
.shutdown_timeout(1)
.bind(("127.0.0.1", 8080))?
.run()
.await?;
Ok(())
}
|