refactor: move api to /api

serve api under /api
This commit is contained in:
Radical 2025-05-04 22:13:05 +02:00
parent f12f81d584
commit ebb4286c08
2 changed files with 12 additions and 4 deletions

View file

@ -1,2 +1,11 @@
pub mod v1; use actix_web::Scope;
pub mod versions; use actix_web::web;
mod v1;
mod versions;
pub fn web() -> Scope {
web::scope("/api")
.service(v1::web())
.service(versions::res)
}

View file

@ -89,8 +89,7 @@ async fn main() -> Result<(), Error> {
HttpServer::new(move || { HttpServer::new(move || {
App::new() App::new()
.app_data(web::Data::new(data.clone())) .app_data(web::Data::new(data.clone()))
.service(api::versions::res) .service(api::web())
.service(api::v1::web())
}) })
.bind((web.url, web.port))? .bind((web.url, web.port))?
.run() .run()