build: add api server health endpoint

This commit is contained in:
2026-04-21 01:36:04 +08:00
parent 6ada003c78
commit ec04790848
7 changed files with 145 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
use axum::{extract::Extension, Json};
use serde_json::{json, Value};
use crate::{api_response::json_success_body, request_context::RequestContext};
pub async fn health_check(
Extension(request_context): Extension<RequestContext>,
) -> Json<Value> {
json_success_body(
Some(&request_context),
json!({
"ok": true,
"service": "genarrative-node-server",
}),
)
}