haro 0.3.0

A simple and synchronous web framework written in and for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use haro::{Application, Request, Response};

fn main() {
    let mut app = Application::new("0:8080");
    app.route("/", |_| Response::str("Haro"));
    app.route("/hello", hello("Haro"));
    app.run();
}

fn hello(name: &str) -> impl Fn(Request) -> Response {
    let name = name.to_string();
    move |_: Request| Response::str(&name)
}