diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-27 01:09:45 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-27 01:09:45 +0200 |
commit | 1dc202f50e35c6ae685b053b7529283af8165a14 (patch) | |
tree | d1ccb9b2b311475727fbe9efcff8f7d55128d607 /indexer/src | |
parent | Indexer: Return json from the /search endpoint (diff) | |
download | OSSE-1dc202f50e35c6ae685b053b7529283af8165a14.tar.gz OSSE-1dc202f50e35c6ae685b053b7529283af8165a14.tar.bz2 OSSE-1dc202f50e35c6ae685b053b7529283af8165a14.zip |
Indexer: Setup permissive CORS
Diffstat (limited to 'indexer/src')
-rw-r--r-- | indexer/src/main.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/indexer/src/main.rs b/indexer/src/main.rs index 44dbd1b..4ea81ae 100644 --- a/indexer/src/main.rs +++ b/indexer/src/main.rs @@ -1,3 +1,4 @@ +use actix_cors::Cors; use actix_web::{get, post, web, App, HttpServer, Responder}; use rand::Rng; use serde::{Deserialize, Serialize}; @@ -42,7 +43,9 @@ async fn serve_http_endpoint(address: &str, port: u16) -> std::io::Result<()> { database: Mutex::new(HashMap::new()), }); HttpServer::new(move || { + let cors = Cors::permissive(); App::new() + .wrap(cors) .app_data(shared_state.clone()) .service(search) .service(add_resource) |