tiny_proxy/api/mod.rs
1//! Management API module for tiny-proxy
2//!
3//! This module provides a REST API for managing the proxy configuration,
4//! including viewing and updating the configuration at runtime.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use tiny_proxy::api;
10//! use tiny_proxy::Config;
11//! use std::sync::Arc;
12//! use tokio::sync::RwLock;
13//!
14//! # #[tokio::main]
15//! # async fn main() -> anyhow::Result<()> {
16//! let config = Arc::new(RwLock::new(Config::from_file("config.caddy")?));
17//!
18//! // Start the management API server
19//! api::start_api_server("127.0.0.1:8081", config).await?;
20//! # Ok(())
21//! # }
22//! ```
23
24pub mod endpoints;
25pub mod middleware;
26pub mod server;
27
28// Re-export commonly used functions for convenience
29pub use server::start_api_server;