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
//! # Haro
//!
//! Haro is a **simple** and **synchronous** web framework written in and for Rust.
//!
//! ## Features
//!
//! - URL Routing with **function**/**closure**/**trait type**
//! - Request & Response with minimal boilerplate
//! - Query args
//! - Post data
//! - JSON
//! - Cookie
//! - Middleware
//! - Template (optional)
//! - Database (optional)
//! - Tests
//!
//! ## Example
//!
//! The "Hello, World!" of Haro is:
//!
//! ```rust,no_run
//! use haro::{Application, Request, Response};
//!
//! fn main() {
//! let mut app = Application::new("0:8000");
//! app.route("/", hello);
//! app.run();
//! }
//!
//! fn hello(_: Request) -> Response {
//! Response::str("Hello Haro")
//! }
//! ```
//!
//! ## Optional Features
//!
//! Haro uses a set of [feature flags] to reduce the amount of compiled code and
//! optional dependencies.
//!
//! You can also use the `full` feature flag which will enable all public APIs.
//! Beware that this will pull in many extra dependencies that you may not need.
//!
//! The following optional features are available:
//!
//! - `database`: Enables Database support.
//! - `template`: Enables Template support.
//!
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
//!
//! ## Examples
//!
//! The Haro repo contains [a number of examples][examples] that show how to put all the
//! pieces together.
//!
//! [examples]: https://github.com/shellfly/haro/tree/main/examples
//!
pub use crateApplication;
pub use crateRequest;
pub use crate;
pub use crate;