Improve search behavior and squelch verbose logging.

This commit is contained in:
2022-11-13 16:27:42 -08:00
parent 431df7da3b
commit c81819dc87
3 changed files with 803 additions and 770 deletions

View File

@@ -18,6 +18,11 @@ fn hello() -> &'static str {
"Hello, world!"
}
#[get("/search")]
async fn search_all(nm: &State<Notmuch>) -> Result<Json<SearchSummary>, Debug<NotmuchError>> {
search(nm, "*").await
}
#[get("/search/<query>")]
async fn search(
nm: &State<Notmuch>,
@@ -103,7 +108,10 @@ async fn main() -> Result<(), Box<dyn Error>> {
.to_cors()?;
let _ = rocket::build()
.mount("/", routes![original_part, original, hello, search, show])
.mount(
"/",
routes![original_part, original, hello, search_all, search, show],
)
.attach(cors)
.manage(Notmuch::default())
//.manage(Notmuch::with_config("../notmuch/testdata/notmuch.config"))