rusty_express 0.4.3

A simple http server library written in Rust and provide Express-alike APIs. We know that Rust is hard and daunting, so we will make sure your server can be easy to use without fear!
Documentation
extern crate rusty_express;

use rusty_express::prelude::*;

fn main() {
    // define http server now
    let mut server = HttpServer::new();
    server.set_pool_size(8);

    //define router directly
    server
        .get(RequestPath::Explicit("/"), simple_response)
        .get(RequestPath::Explicit("/index"), simple_redirect)
        .get(RequestPath::Explicit("/fail_check"), simple_redir_fail);

    server.listen(8080);
}

pub fn simple_response(_req: &Box<Request>, resp: &mut Box<Response>) {
    //this content will be skipped because of the redirection
    resp.send("Hello world from rusty server!\n");

    //call redirect
    resp.redirect("/index");
}

pub fn simple_redirect(_req: &Box<Request>, resp: &mut Box<Response>) {
    resp.send("Now empowered with the redirect!\n");
}

pub fn simple_redir_fail(_req: &Box<Request>, resp: &mut Box<Response>) {
    //call redirect
    resp.redirect("/fail");
}