[API] Refactor: Remove CORS fairing

- activated static route for frontend service,
- removed CORS fairing for production use
This commit is contained in:
Mercury. 2025-06-04 10:05:19 +02:00
parent f191fc646e
commit 37f0c72114

View file

@ -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) rocket::custom(figment)
.attach(cors)
.manage(pool) .manage(pool)
.mount("/api", routes![ .mount("/api", routes![
register, register,
@ -78,8 +73,8 @@ async fn main() -> Result<(), rocket::Error> {
update_quota, update_quota,
all_options, all_options,
]) ])
//.mount("/", FileServer::from("/app/static").rank(10)) .mount("/", FileServer::from("./static").rank(10))
//.register("/", catchers![not_found]) .register("/", catchers![not_found])
.launch() .launch()
.await?; .await?;