diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-27 12:48:32 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-10-27 12:48:39 +0200 |
commit | 1003ec9451abc5a1f8d51ac353605aa314ebfd6c (patch) | |
tree | d1dc0eb39219cdab4d300fe63056bf75b52923b3 | |
parent | Crawler: Replace String::from with .to_string() (diff) | |
download | OSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.tar.gz OSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.tar.bz2 OSSE-1003ec9451abc5a1f8d51ac353605aa314ebfd6c.zip |
Indexer: Add /search with no query endpoint
Just returns [].
-rw-r--r-- | indexer/src/main.rs | 6 |
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(); |