diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 941df3a..69eed5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,25 +24,24 @@ struct AppState { #[actix_web::main] async fn main() -> std::io::Result<()> { - // Errors can get very tough, - // the rust log saved my ass + /* Enable the log */ std::env::set_var("RUST_LOG", "debug"); env_logger::init(); dotenv().ok(); - /* create database wrapper (reference: acsim) */ + /* Create database wrapper (reference: acsim) */ let db_raw = match database::DatabaseWrapper::new().await { Ok(res) => res, Err(_) => panic!("Error creating database wrapper"), }; let db = Arc::new(db_raw); - /* get jwt secret from env */ + /* Get jwt secret from env */ let jwt_secret = env::var("SECRET") .expect("environment variable SECRET is *probably not setted up!!") .to_string(); - /* application data struct */ + /* Application data struct */ let app_state = AppState { database: db, secret: jwt_secret, @@ -80,7 +79,7 @@ async fn main() -> std::io::Result<()> { // let openapi = ApiDoc::openapi(); - /* main server setup */ + /* Server setup */ HttpServer::new(move || { App::new() .app_data(web::Data::new(app_state.clone())) @@ -97,7 +96,7 @@ async fn main() -> std::io::Result<()> { .await } -/* main page*/ +/* Main page*/ async fn root() -> String { String::from("Server is up and running") } |