modo-rs 0.8.0

Rust web framework for small monolithic apps
Documentation
//! # modo::server
//!
//! HTTP server startup, host-based routing, and graceful shutdown.
//!
//! Provides:
//!
//! - [`Config`] — bind address and shutdown timeout, loaded from YAML.
//! - [`http()`] — binds a TCP listener and returns an [`HttpServer`] handle.
//! - [`HttpServer`] — opaque server handle that implements
//!   [`crate::runtime::Task`] for use with the [`crate::run!`] macro.
//! - [`HostRouter`] — routes requests to different axum routers by `Host` header;
//!   supports exact matches and single-level wildcard subdomains.
//! - [`MatchedHost`] — axum extractor for the subdomain captured by a wildcard
//!   `HostRouter` pattern.
//!
//! ## Quick start
//!
//! ```no_run
//! use modo::server::{Config, http};
//!
//! #[tokio::main]
//! async fn main() -> modo::Result<()> {
//!     let config = Config::default();
//!     let router = modo::axum::Router::new();
//!     let server = http(router, &config).await?;
//!     modo::run!(server).await
//! }
//! ```

mod config;
mod host_router;
mod http;

pub use config::Config;
pub use host_router::{HostRouter, MatchedHost};
pub use http::{HttpServer, http};