about summary refs log tree commit diff
path: root/indexer/src
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-10-27 01:09:45 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-10-27 01:09:45 +0200
commit1dc202f50e35c6ae685b053b7529283af8165a14 (patch)
treed1ccb9b2b311475727fbe9efcff8f7d55128d607 /indexer/src
parentIndexer: Return json from the /search endpoint (diff)
downloadOSSE-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.rs3
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)