feat: API version endpoint

This commit is contained in:
Ninjdai 2025-08-08 01:34:50 +02:00
parent 88aaf3d0d6
commit c0f0d0521b
3 changed files with 18 additions and 0 deletions

View file

@ -199,6 +199,7 @@ async fn run_server(db: Arc<DatabaseConnection>, port: u16) {
.routes(routes!(routes::auth::auth))
.routes(routes!(routes::auth::check_token))
// Misc
.routes(routes!(routes::misc::current_api_version))
.routes(routes!(routes::websocket::ws_handler))
.with_state(shared_state.clone());

16
src/routes/misc.rs Normal file
View file

@ -0,0 +1,16 @@
use axum::Json;
#[axum::debug_handler]
#[utoipa::path(
get,
path = "/version",
responses(
(status = OK, body = u64, description = "Current API version")
),
summary = "Get the current API version",
tag = "misc",
)]
pub async fn current_api_version() -> Json<u64> {
Json(1)
}

View file

@ -2,6 +2,7 @@ pub mod auth;
pub mod bal;
pub mod book;
pub mod book_instance;
pub mod misc;
pub mod owner;
pub mod websocket;