From 8b7bd0a73f92c06e98902093e7ef5f12f974f882 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 12 Sep 2022 14:28:09 +0200 Subject: Uploaded files routing --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.rs') 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()) -- cgit v1.2.3-71-g8e6c