From 552f5b5f5559de79a21f995dc4d2ce6ad9493f51 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Thu, 3 Nov 2022 11:37:35 +0100 Subject: Indexer: Add missing /search/ route This previously caused no output when doing an empty search through the frontend. --- indexer/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indexer') diff --git a/indexer/src/main.rs b/indexer/src/main.rs index 9467cff..51a0e20 100644 --- a/indexer/src/main.rs +++ b/indexer/src/main.rs @@ -1,7 +1,7 @@ mod indexer_implementation; use actix_cors::Cors; -use actix_web::{get, post, web, App, HttpServer, Responder}; +use actix_web::{get, post, routes, web, App, HttpServer, Responder}; use indexer_implementation::IndexerImplementation; use kuchiki::traits::TendrilSink; use lib::lib::*; @@ -130,7 +130,9 @@ async fn add_resource( format!("{resource:?}") } +#[routes] #[get("/search")] +#[get("/search/")] async fn no_search(_data: web::Data) -> impl Responder { "[]".to_string() } @@ -140,6 +142,7 @@ async fn search(data: web::Data, term: web::Path) -> impl Resp let indexer = data.indexer.lock().unwrap(); let results = indexer.search(&term); + //+is lowercase search good (we turn ascii lowercase, what do we do with inserting) serde_json::to_string(&results.unwrap()).unwrap() } -- cgit 1.4.1