1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Project: hyperi-rustlib
// File: src/http_server/mod.rs
// Purpose: High-performance HTTP server with axum
// Language: Rust
//
// License: BUSL-1.1
// Copyright: (c) 2026 HYPERI PTY LIMITED
//! HTTP server built on axum. Compatible with Tonic for gRPC.
//!
//! ## Features
//!
//! - Graceful shutdown
//! - Configurable request timeout, in-flight cap, Tower middleware
//! - Health endpoints (`/healthz`, `/readyz`, plus `/health/*` aliases)
//!
//! In-process TLS and a `/metrics` endpoint are NOT wired here -- see
//! [`HttpServerConfig`]. Terminate TLS at the ingress / mesh; metrics are
//! served by `MetricsManager` on its own listener.
//!
//! ## Example
//!
//! ```rust,no_run
//! use hyperi_rustlib::http_server::{HttpServer, HttpServerConfig};
//! use axum::{Router, routing::get};
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let config = HttpServerConfig {
//! bind_address: "0.0.0.0:8080".to_string(),
//! ..Default::default()
//! };
//!
//! let app = Router::new()
//! .route("/", get(|| async { "Hello, World!" }));
//!
//! let server = HttpServer::new(config);
//! server.serve(app).await?;
//! # Ok(())
//! # }
//! ```
pub use HttpServerConfig;
pub use HttpServerError;
pub use HttpServer;
// Re-export axum types users commonly need
pub use ;
/// Result type for HTTP server operations.
pub type Result<T> = Result;