diff options
author | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2025-01-26 12:55:13 +0100 |
---|---|---|
committer | niliara-edu <nil.jimeno@estudiant.fjaverianas.com> | 2025-01-26 12:55:13 +0100 |
commit | 5891af7e8c1411029fe1ad9c6d3182f88bcf3dfd (patch) | |
tree | fde6a420e55faaf9c696298b5aedb849c1b39189 /src/main.rs | |
parent | 5898e5ab4359945ef52dc7460bb2937a85603fc2 (diff) |
comment and update information
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") } |