Rename the indexing warp routes

This commit is contained in:
Clément Renault 2020-11-02 15:30:29 +01:00
parent 9b08f48dbd
commit 0c612f08c7
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -516,7 +516,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
let update_store_cloned = update_store.clone(); let update_store_cloned = update_store.clone();
let update_status_sender_cloned = update_status_sender.clone(); let update_status_sender_cloned = update_status_sender.clone();
let indexing_route_csv = warp::filters::method::post() let indexing_csv_route = warp::filters::method::post()
.and(warp::path!("documents")) .and(warp::path!("documents"))
.and(warp::header::exact_ignore_case("content-type", "text/csv")) .and(warp::header::exact_ignore_case("content-type", "text/csv"))
.and(warp::filters::query::query()) .and(warp::filters::query::query())
@ -533,7 +533,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
let update_store_cloned = update_store.clone(); let update_store_cloned = update_store.clone();
let update_status_sender_cloned = update_status_sender.clone(); let update_status_sender_cloned = update_status_sender.clone();
let indexing_route_json = warp::filters::method::post() let indexing_json_route = warp::filters::method::post()
.and(warp::path!("documents")) .and(warp::path!("documents"))
.and(warp::header::exact_ignore_case("content-type", "application/json")) .and(warp::header::exact_ignore_case("content-type", "application/json"))
.and(warp::filters::query::query()) .and(warp::filters::query::query())
@ -550,7 +550,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
let update_store_cloned = update_store.clone(); let update_store_cloned = update_store.clone();
let update_status_sender_cloned = update_status_sender.clone(); let update_status_sender_cloned = update_status_sender.clone();
let indexing_route_json_stream = warp::filters::method::post() let indexing_json_stream_route = warp::filters::method::post()
.and(warp::path!("documents")) .and(warp::path!("documents"))
.and(warp::header::exact_ignore_case("content-type", "application/x-ndjson")) .and(warp::header::exact_ignore_case("content-type", "application/x-ndjson"))
.and(warp::filters::query::query()) .and(warp::filters::query::query())
@ -565,6 +565,7 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
) )
}); });
let update_store_cloned = update_store.clone();
let update_status_sender_cloned = update_status_sender.clone(); let update_status_sender_cloned = update_status_sender.clone();
let clearing_route = warp::filters::method::post() let clearing_route = warp::filters::method::post()
.and(warp::path!("clear-documents")) .and(warp::path!("clear-documents"))
@ -618,10 +619,11 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
.or(dash_logo_white_route) .or(dash_logo_white_route)
.or(dash_logo_black_route) .or(dash_logo_black_route)
.or(query_route) .or(query_route)
.or(indexing_route_csv) .or(indexing_csv_route)
.or(indexing_route_json) .or(indexing_json_route)
.or(indexing_route_json_stream) .or(indexing_json_stream_route)
.or(clearing_route) .or(clearing_route)
.or(change_settings_route)
.or(update_ws_route); .or(update_ws_route);
let addr = SocketAddr::from_str(&opt.http_listen_addr)?; let addr = SocketAddr::from_str(&opt.http_listen_addr)?;