From 1003ec9451abc5a1f8d51ac353605aa314ebfd6c Mon Sep 17 00:00:00 2001 From: Baitinq Date: Thu, 27 Oct 2022 12:48:32 +0200 Subject: Indexer: Add /search with no query endpoint Just returns []. --- indexer/src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indexer') 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, resource: web::Json) format!("{:?}", resource) } +#[get("/search")] +async fn no_search(_data: web::Data) -> impl Responder { + "[]".to_string() +} + #[get("/search/{term}")] async fn search(data: web::Data, term: web::Path) -> impl Responder { let query: Vec<&str> = term.split(' ').collect(); -- cgit 1.4.1