Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 463 Bytes

README.md

File metadata and controls

29 lines (20 loc) · 463 Bytes

Balu

This is just a learning experiment.


A single-thread blocking HTTP server.

use balu::{Request, Response, Router, Server};

fn main() {
    let router = Router::new()
        .get("/echo1", echo1)
        .get("/echo2", echo2);

    Server::new(router).serve();
}

fn echo1(request: Request) -> String {
    request.body
}

fn echo2(request: Request) -> Response {
    Response::new().body(request.body)
}

Missing features: all of them.