kova-api 0.4.0

Kova HTTP API: health probe, embedded GUI, and engine endpoints
Documentation
//! The embedded GUI document and the health probe.

use axum::http::{
    header::{self, HeaderValue},
    HeaderMap,
};
use axum::Json;
use kova_gui::index_html;
use serde_json::{json, Value};

/// `GET /health` — liveness for the engine process.
pub async fn health() -> Json<Value> {
    Json(json!({
        "status": "ok",
        "service": "kova",
        "version": env!("CARGO_PKG_VERSION"),
    }))
}

/// `GET /` — the embedded GUI (see `kova-gui`).
pub async fn index() -> (HeaderMap, String) {
    let mut headers = HeaderMap::new();
    headers.insert(
        header::CONTENT_TYPE,
        HeaderValue::from_static("text/html; charset=utf-8"),
    );
    (headers, index_html())
}