feat: implement CORS support with configuration options and middleware integration

This commit is contained in:
GW_MC
2025-12-19 21:34:12 +08:00
parent d861e0cd7d
commit b0b765b8fa
7 changed files with 86 additions and 9 deletions

View File

@@ -88,8 +88,10 @@ pub async fn start_server() {
// build the axum app and run the server...
info!("Starting application...");
let mut app: Router =
routes::get_root_router(Arc::new(get_app_state(&db_connection, &settings)));
let mut app: Router = routes::get_root_router(
Arc::new(get_app_state(&db_connection, &settings)),
Arc::new(settings.server.cors.clone()),
);
if settings.server.serve_openapi {
info!("Enabling OpenAPI documentation endpoint at /openapi.json");