From 37f0c72114bee2e464e76de531b9b1f0fa96a27c Mon Sep 17 00:00:00 2001 From: Mercury Date: Wed, 4 Jun 2025 10:05:19 +0200 Subject: [PATCH] [API] Refactor: Remove CORS fairing - activated static route for frontend service, - removed CORS fairing for production use --- api/src/main.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/src/main.rs b/api/src/main.rs index 0d35c88..b1af548 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -56,12 +56,7 @@ async fn main() -> Result<(), rocket::Error> { )); - let cors = CorsOptions::default() - .to_cors() - .expect("Failed to create CORS fairing"); - rocket::custom(figment) - .attach(cors) .manage(pool) .mount("/api", routes![ register, @@ -78,8 +73,8 @@ async fn main() -> Result<(), rocket::Error> { update_quota, all_options, ]) - //.mount("/", FileServer::from("/app/static").rank(10)) - //.register("/", catchers![not_found]) + .mount("/", FileServer::from("./static").rank(10)) + .register("/", catchers![not_found]) .launch() .await?;