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
//! Mockd — a lightweight standalone mock HTTP server.
//!
//! Mockd lets you stand up a realistic HTTP API from a declarative YAML
//! configuration, without writing any code. It is designed for local
//! development, integration tests and CI/CD pipelines.
//!
//! # Module overview
//!
//! - [`config`] — domain models and YAML configuration loading.
//! - [`router`] — request matching against the configured routes.
//! - [`template`] — `{{path.id}}` / `{{query.x}}` / `{{header.y}}` rendering.
//! - [`server`] — the Axum HTTP layer.
//!
//! # Quick start
//!
//! ```no_run
//! use mockd::{config::Config, server::Server};
//!
//! # async fn run() -> anyhow::Result<()> {
//! let yaml = r#"
//! listen: ":8080"
//! routes:
//! - method: GET
//! path: /health
//! response:
//! status: 200
//! body:
//! ok: true
//! "#;
//! let config = Config::parse(yaml)?;
//! let server = Server::from_config(config)?;
//! server.serve().await?;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;