diff options
Diffstat (limited to 'kittybox-rs/src/media/mod.rs')
-rw-r--r-- | kittybox-rs/src/media/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kittybox-rs/src/media/mod.rs b/kittybox-rs/src/media/mod.rs index 4a253d0..b64929d 100644 --- a/kittybox-rs/src/media/mod.rs +++ b/kittybox-rs/src/media/mod.rs @@ -98,3 +98,10 @@ pub async fn serve<S: MediaStore>( } } } + +pub fn router<S: MediaStore>(blobstore: S) -> axum::Router { + axum::Router::new() + .route("/", axum::routing::post(upload::<S>)) + .route("/uploads/*file", axum::routing::get(serve::<S>)) + .layer(axum::Extension(blobstore)) +} |