From 47ce809ce33be00ee3b20df8da5e4515e052ec7a Mon Sep 17 00:00:00 2001 From: Marshall Ku Date: Wed, 3 Jul 2024 00:16:44 +0900 Subject: [PATCH] Move constants to constants dir --- src/constants/mod.rs | 1 + src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/constants/mod.rs diff --git a/src/constants/mod.rs b/src/constants/mod.rs new file mode 100644 index 0000000..a8eaa0a --- /dev/null +++ b/src/constants/mod.rs @@ -0,0 +1 @@ +pub const CDN_ROOT: &str = "cdn_root"; diff --git a/src/main.rs b/src/main.rs index 3b0a419..2153fee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +mod constants; mod env; mod utils; @@ -7,6 +8,7 @@ use axum::{ routing::get, Router, }; +use constants::CDN_ROOT; use env::state::AppState; use reqwest::StatusCode; use std::path::PathBuf; @@ -21,8 +23,6 @@ use utils::{ path::{get_original_path, get_resize_width_from_path}, }; -const CDN_ROOT: &str = "cdn_root"; - async fn handle_files_request( State(state): State, Path(path): Path,