rusty_express 0.2.7

A simple server written in Rust and provide Express-alike APIs. Many things are changing and I'm working on completing more features. Please visit the project repository to submit issues or feature requests.
Documentation

Rusty_Express

Rusty_Express on crates.io Rusty_Express on docs.rs

What is this

A simple http server library written in Rust and provide Express-alike APIs.

Feature Request and PR Welcome

The project is new and lack many common http server features. Please feel free to submit feature request as an issue.

You're also very welcome to submit PR to fix bugs or implement new features.

How to use

In your project's Cargo.toml, add dependency:

[dependencies]
rusty_express = "^0.2.7"
...

In src\main.rs:

extern crate rusty_express;

use rusty_express::prelude::*;

fn main() {
    //A http server with default thread pool size of 4
    let mut server = HttpServer::new();
    //Change thread pool size to 8.
    server.set_pool_size(8);

    //Route definition
    server.get(RequestPath::Exact("/"), simple_response);

    //Listen to port 8080, server has started.
    server.listen(8080);
}

pub fn simple_response(req: &Request, resp: &mut Response) {
    resp.send("Hello world from the rusty-express server!\n");
    resp.status(200);
}

Examples