af-web — reusable axum web infrastructure (the cross-cutting half of
agent_core/api/). Provides:
- [
ApiError] — JSON error envelope carrying the request id. - [
middleware::request_id] / [middleware::latency_slo] — request-id propagation and the API latency SLO (warn past [middleware::SLO_BUDGET_MS]). - [
with_standard_middleware] — wrap anyRouterwith the standard stack. - [
health] — a ready-made health handler. - [
metrics] — a minimal Prometheus-compatible liveness metric.
A service composes its product routes and wraps them:
let app = with_standard_middleware(
Router::new().route("/health", get(health)).merge(product_routes),
);