finchers 0.1.2

A combinator library for builidng HTTP services, based on Hyper and Futures
Documentation

finchers

Build Status crates.io docs-rs

finchers is a combinator library for building HTTP services, based on hyper and futures.

The concept and design of this library is highly inspired by finch and combine.

Features

  • ease of use
  • asynchronous handling based on Futures and Hyper 0.11
  • type-safe routing

Example

extern crate finchers;

use finchers::{Endpoint, Json};
use finchers::combinator::method::get;
use finchers::combinator::path::{string_, end_};

fn main() {
    // create a factory of endpoints.
    let new_endpoint = || {
        get(
            "hello".with(string_).skip(end_)
                .map(|name| Json(format!("Hello, {}", name)))
        )
    };

    // start a HTTP server with above factory.
    finchers::server::run_http(new_endpoint, "127.0.0.1:3000");
}

More examples are located in examples/.

License

Dual licensed under the MIT and Apache 2.0