Renamed endpoints.rs to endpoints_v1.rs

APIs will now use /v1/...
This commit is contained in:
Jordon Brooks 2023-06-24 02:19:55 +01:00
parent 560b90be55
commit 8169dfd022
8 changed files with 66 additions and 19 deletions

View file

@ -1,6 +1,6 @@
use actix_web::HttpServer;
use actix_web::{HttpServer, web};
use crate::api::endpoints::*;
use crate::api::endpoints_v1;
#[allow(dead_code)]
pub async fn stop_actix_web(server: actix_web::dev::Server) -> std::io::Result<()> {
@ -17,12 +17,7 @@ pub fn start_actix_web(port: u16) -> std::io::Result<actix_web::dev::Server> {
let logger = actix_web::middleware::Logger::default();
actix_web::App::new()
.wrap(logger)
.service(index)
.service(get_all_info)
.service(get_os_info)
.service(get_battery_info)
.service(get_version_info)
.service(get_dock_info)
.service(web::scope("/v1").configure(endpoints_v1::configure))
})
.bind(("127.0.0.1", port))?
.run();