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
60
61
62
// Project: hyperi-rustlib
// File: src/http_server/mod.rs
// Purpose: High-performance HTTP server with axum
// Language: Rust
//
// License: FSL-1.1-ALv2
// Copyright: (c) 2026 HYPERI PTY LIMITED
//! High-performance HTTP server built on axum.
//!
//! This module provides a configurable HTTP server suitable for building
//! APIs, health endpoints, and metrics servers. It uses axum for ergonomics
//! and is compatible with Tonic for gRPC.
//!
//! ## Features
//!
//! - Graceful shutdown support
//! - Configurable timeouts (request, keep-alive)
//! - Optional TLS support
//! - Health check endpoints (`/health/live`, `/health/ready`)
//! - Metrics endpoint (`/metrics`)
//! - Tower middleware integration
//!
//! ## 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;