about summary refs log tree commit diff
path: root/indexer
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-10-27 12:48:32 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-10-27 12:48:39 +0200
commit1003ec9451abc5a1f8d51ac353605aa314ebfd6c (patch)
treed1dc0eb39219cdab4d300fe63056bf75b52923b3 /indexer
parentCrawler: Replace String::from with .to_string() (diff)
downloadOSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.tar.gz
OSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.tar.bz2
OSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.zip
Indexer: Add /search with no query endpoint
Just returns [].
Diffstat (limited to 'indexer')
-rw-r--r--indexer/src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/indexer/src/main.rs b/indexer/src/main.rs
index 4ea81ae..aefcc2b 100644
--- a/indexer/src/main.rs
+++ b/indexer/src/main.rs
@@ -47,6 +47,7 @@ async fn serve_http_endpoint(address: &str, port: u16) -> std::io::Result<()> {
         App::new()
             .wrap(cors)
             .app_data(shared_state.clone())
+            .service(no_search)
             .service(search)
             .service(add_resource)
     })
@@ -96,6 +97,11 @@ async fn add_resource(data: web::Data<AppState>, resource: web::Json<Resource>)
     format!("{:?}", resource)
 }
 
+#[get("/search")]
+async fn no_search(_data: web::Data<AppState>) -> impl Responder {
+    "[]".to_string()
+}
+
 #[get("/search/{term}")]
 async fn search(data: web::Data<AppState>, term: web::Path<String>) -> impl Responder {
     let query: Vec<&str> = term.split(' ').collect();