diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2022-09-12 12:28:09 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-12 12:28:09 +0000 |
| commit | 8b7bd0a73f92c06e98902093e7ef5f12f974f882 (patch) | |
| tree | 5f4c81b9ca2c58225b5061396e963cd5735b66ba /src/main.rs | |
| parent | af90ce3578cc46045d96938c9193f4ab8b9faccc (diff) | |
Uploaded files routing
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index f0d7661..fd58313 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,9 +7,11 @@ mod models; mod pagination; mod routes; +use crate::config::UPLOADS_ENDPOINT; use axum::{ handler::Handler, http::{header, Request}, + routing::get, Router, }; use std::time::Duration; @@ -43,6 +45,10 @@ async fn create_app() -> Router { .nest("/models", routes::model::create_route()); Router::new() + .route( + &format!("{}/:id", UPLOADS_ENDPOINT).to_owned(), + get(crate::files::show_uploads), + ) // Map all routes to `/v1/*` namespace .nest("/v1", api_routes) .fallback(crate::routes::page_404.into_service()) |
