diff --git a/server/src/auth/login.rs b/server/src/auth/login.rs index 7076f5e..f65e86a 100644 --- a/server/src/auth/login.rs +++ b/server/src/auth/login.rs @@ -8,7 +8,6 @@ use homedisk_types::{ use crate::middleware::{create_token, validate_json}; -/// Handle `/auth/login` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/auth/mod.rs b/server/src/auth/mod.rs index d520f66..e255e1b 100644 --- a/server/src/auth/mod.rs +++ b/server/src/auth/mod.rs @@ -1,7 +1,8 @@ -pub mod login; -pub mod register; -pub mod whoami; +mod login; +mod register; +mod whoami; +/// Handle `/api/auth/*` requests pub fn app() -> axum::Router { use axum::routing::{get, post}; diff --git a/server/src/auth/register.rs b/server/src/auth/register.rs index 0ed380e..022fb5d 100644 --- a/server/src/auth/register.rs +++ b/server/src/auth/register.rs @@ -10,7 +10,6 @@ use homedisk_types::{ use crate::middleware::{create_token, validate_json}; -/// Handle `/auth/register` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/auth/whoami.rs b/server/src/auth/whoami.rs index 8026423..e37a8db 100644 --- a/server/src/auth/whoami.rs +++ b/server/src/auth/whoami.rs @@ -9,7 +9,6 @@ use homedisk_types::{ use crate::middleware::validate_jwt; -/// Handle `/auth/whoami` requests pub async fn handle( db: Extension, config: Extension, diff --git a/server/src/fs/create_dir.rs b/server/src/fs/create_dir.rs index bcc46df..a705065 100644 --- a/server/src/fs/create_dir.rs +++ b/server/src/fs/create_dir.rs @@ -13,7 +13,6 @@ use crate::middleware::{find_user, validate_json, validate_jwt}; use super::validate_path; -/// Handle `/fs/createdir` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/fs/delete.rs b/server/src/fs/delete.rs index a34541c..a7c2c66 100644 --- a/server/src/fs/delete.rs +++ b/server/src/fs/delete.rs @@ -14,7 +14,6 @@ use crate::middleware::{find_user, validate_jwt}; use super::validate_path; -/// Handle `/fs/delete` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/fs/download.rs b/server/src/fs/download.rs index f8b73ac..dc48cd7 100644 --- a/server/src/fs/download.rs +++ b/server/src/fs/download.rs @@ -11,7 +11,6 @@ use crate::middleware::{find_user, validate_jwt}; use super::validate_path; -/// Handle `/fs/download` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/fs/list.rs b/server/src/fs/list.rs index 5d73975..24be1df 100644 --- a/server/src/fs/list.rs +++ b/server/src/fs/list.rs @@ -32,7 +32,6 @@ fn dir_size(path: impl Into) -> io::Result { dir_size(fs::read_dir(path.into())?) } -/// Handle `/fs/list` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/fs/mod.rs b/server/src/fs/mod.rs index 081509b..8462b84 100644 --- a/server/src/fs/mod.rs +++ b/server/src/fs/mod.rs @@ -1,9 +1,10 @@ -pub mod create_dir; -pub mod delete; -pub mod download; -pub mod list; -pub mod upload; +mod create_dir; +mod delete; +mod download; +mod list; +mod upload; +/// Handle `/api/fs/*` requests pub fn app() -> axum::Router { use axum::routing::{delete, get, post}; diff --git a/server/src/fs/upload.rs b/server/src/fs/upload.rs index 36bb836..93841b6 100644 --- a/server/src/fs/upload.rs +++ b/server/src/fs/upload.rs @@ -16,7 +16,6 @@ use crate::middleware::{find_user, validate_jwt}; use super::validate_path; -/// Handle `/fs/upload` requests pub async fn handle( Extension(db): Extension, Extension(config): Extension, diff --git a/server/src/lib.rs b/server/src/lib.rs index 9efe447..2d19cb7 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -29,8 +29,8 @@ pub async fn serve_http( // create http Router let app = Router::new() .route("/health-check", get(health_check)) - .nest("/auth", auth::app()) - .nest("/fs", fs::app()) + .nest("/api/auth", auth::app()) + .nest("/api/fs", fs::app()) .layer(CorsLayer::new().allow_origin(AllowOrigin::list(origins))) .layer(Extension(db)) .layer(Extension(config));