feat(api): add health probes, OpenAPI doc, and router
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user