mini_http

Build Status

Note: This project is a work in progress and shouldn't be used in any critical production environment.

A basic asynchronous* http server using mio

*While network IO is performed asynchronously, handler functions are executed synchronously in a thread pool.

Usage

See examples

```rust extern crate mini_http;

fn run() -> Result<(), Box> { minihttp::Server::new("127.0.0.1:3000")? .start(|request| { println!("{:?}", std::str::fromutf8(request.body())); let resp = if request.body().len() > 0 { request.body().tovec() } else { b"hello!".tovec() }; mini_http::HttpResponse::builder() .status(200) .header("X-What-Up", "Nothin") .body(resp) .unwrap() })?; Ok(()) } ```