Improve search behavior and squelch verbose logging.
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user