vintage 0.3.0

A multi-threaded FastCGI server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use vintage::pipe::{Pipe, Router};
use vintage::start;

fn main() {
    let router = Router::new()
        .get("/echo/{msg}", |ctx, params| {
            let msg = &params["msg"];
            ctx.with_html_body(msg).with_status(200)
        })
        .get("/greet", |ctx, _| {
            ctx.with_html_body("<h1>Hello World</h1>").with_status(200)
        });

    let server = start("localhost:8000", move |ctx| router.run(ctx)).unwrap();

    server.join();
}