From ebb4286c088158ec4235c5e92dfeaef177131cdb Mon Sep 17 00:00:00 2001 From: Radical Date: Sun, 4 May 2025 22:13:05 +0200 Subject: [PATCH] refactor: move api to /api serve api under /api --- src/api/mod.rs | 13 +++++++++++-- src/main.rs | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index 80dc442..b79c824 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1,2 +1,11 @@ -pub mod v1; -pub mod versions; +use actix_web::Scope; +use actix_web::web; + +mod v1; +mod versions; + +pub fn web() -> Scope { + web::scope("/api") + .service(v1::web()) + .service(versions::res) +} diff --git a/src/main.rs b/src/main.rs index fbde53b..e967021 100644 --- a/src/main.rs +++ b/src/main.rs @@ -89,8 +89,7 @@ async fn main() -> Result<(), Error> { HttpServer::new(move || { App::new() .app_data(web::Data::new(data.clone())) - .service(api::versions::res) - .service(api::v1::web()) + .service(api::web()) }) .bind((web.url, web.port))? .run()