feat(api): add health probes, OpenAPI doc, and router

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 00:58:29 +02:00
parent 8da3eefdce
commit b9acc03761
4 changed files with 180 additions and 0 deletions
+23
View File
@@ -1 +1,24 @@
//! HTTP API: router, handlers, and OpenAPI document.
mod health;
mod openapi;
use axum::Router;
use db::Db;
/// Shared application state passed to handlers.
#[derive(Clone)]
pub struct AppState {
/// Database handle for this organization.
pub db: Db,
/// User-facing product name (from config). Never hardcoded.
pub app_name: String,
}
/// Build the application router from shared state.
pub fn build_app(state: AppState) -> Router {
Router::new()
.merge(health::routes())
.merge(openapi::routes())
.with_state(state)
}