about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-03 11:37:35 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-03 11:37:42 +0100
commit552f5b5f5559de79a21f995dc4d2ce6ad9493f51 (patch)
treedf5e1e4317c371999925a319fb2f0c350b7d8754
parentLib: Only care about url for Eq and Hash implementation in IndexedResource (diff)
downloadOSSE-552f5b5f5559de79a21f995dc4d2ce6ad9493f51.tar.gz
OSSE-552f5b5f5559de79a21f995dc4d2ce6ad9493f51.tar.bz2
OSSE-552f5b5f5559de79a21f995dc4d2ce6ad9493f51.zip
Indexer: Add missing /search/ route
This previously caused no output when doing an empty search through the frontend.
-rw-r--r--indexer/src/main.rs5
1 files changed, 4 insertions, 1 deletions
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<AppState>) -> impl Responder {
     "[]".to_string()
 }
@@ -140,6 +142,7 @@ async fn search(data: web::Data<AppState>, term: web::Path<String>) -> 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()
 }