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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! desirable - A minimal and pragmatic Rust web application framework.
//!
//! This crate provides a lightweight HTTP server framework built on top of [hyper](https://github.com/hyperium/hyper).
//! It is inspired by [axum](https://github.com/tokio-rs/axum), [tide](https://github.com/http-rs/tide), and [tinyweb](https://github.com/zzzdong/tinyweb).
//!
//! # Quick Start
//!
//! ```rust,ignore
//! use desirable::{Router, Result};
//! use std::env;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! let mut router = Router::new();
//! router.get("/", || async { "Hello, World!" });
//!
//! let addr = env::args()
//! .nth(1)
//! .unwrap_or_else(|| "127.0.0.1:3000".to_string());
//!
//! desirable::new(&addr).run(router).await
//! }
//! ```
//!
//! # Features
//!
//! - **Router** - HTTP method routing with path parameter support
//! - **Middleware** - composable middleware stack
//! - **Request/Response** - ergonomic HTTP types
//! - **Static Files** - file and directory serving
//! - **Async/Await** - fully asynchronous throughout
pub use Error;
pub use ;
pub use IntoResponse;
pub use ;
pub use Request;
pub use Response;
pub use Router;
pub use Server;
pub use ;
pub use ;
/// Creates a new [`Server`] bound to the given address.
///
/// This is a convenience function for quickly setting up a server.
/// For more control over server configuration, use [`Server::bind`] directly.
///
/// # Examples
///
/// ```rust,ignore
/// use desirable::{Router, Result};
///
/// #[tokio::main]
/// async fn main() -> Result<()> {
/// let router = Router::new();
/// desirable::new("127.0.0.1:8080").run(router).await
/// }
/// ```
// re-export
pub use body;
pub use header;
pub use http;