refactor: move api to /api
serve api under /api
This commit is contained in:
parent
f12f81d584
commit
ebb4286c08
2 changed files with 12 additions and 4 deletions
|
@ -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)
|
||||||
|
}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue