Added a new api: "/api/supported_versions" to query the server of supported API versions

This commit is contained in:
Jordon Brooks 2023-06-25 12:36:27 +01:00
parent 89b2a2ae51
commit bb5fb386a7
3 changed files with 18 additions and 1 deletions

View file

@ -1,6 +1,7 @@
use actix_web::{HttpServer, web};
use crate::api::endpoints_v1;
use crate::api::api;
#[allow(dead_code)]
pub async fn stop_actix_web(server: actix_web::dev::Server) -> std::io::Result<()> {
@ -17,6 +18,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(web::scope("/api").configure(api::configure))
.service(web::scope("/v1").configure(endpoints_v1::configure))
})
.bind(("127.0.0.1", port))?