From 7d4f771b3dcb4f99569ebe0f69c2c74f7395b95e Mon Sep 17 00:00:00 2001 From: blek Date: Tue, 10 Oct 2023 22:04:15 +1000 Subject: [PATCH] scratch uploaded file handler --- filed/src/web/mod.rs | 4 +++- filed/src/web/uploaded.rs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 filed/src/web/uploaded.rs diff --git a/filed/src/web/mod.rs b/filed/src/web/mod.rs index f4eaeb8..7a0b81c 100644 --- a/filed/src/web/mod.rs +++ b/filed/src/web/mod.rs @@ -14,6 +14,7 @@ mod forms; mod state; mod rejection; mod api; +mod uploaded; use state::SharedState; @@ -23,7 +24,8 @@ pub fn routes(state: SharedState) -> impl Filter Result, Rejection> { + Ok(Box::new(html(file))) +} + +pub fn get_uploaded(state: SharedState) -> impl Filter + Clone { + warp::path!("upload" / String) + .map(move |x| (x, state.clone())) + .and_then(uploaded) +} \ No newline at end of file