finchers 0.6.0

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
  • focuse on stable channel

Example

extern crate finchers;

use finchers::{Endpoint, Json};
use finchers::endpoint::FromPath;
use finchers::endpoint::method::get;
use finchers::server::Server;

fn main() {
    // create an endpoint
    let endpoint = |_: &_| {
        get("hello".with(String::PATH)).map(|name| {
            Json(format!("Hello, {}", name))
        })
    };

    // start a HTTP server.
    Server::new(endpoint).bind("127.0.0.1:3000").run_http();
}

More examples are located in examples/.

Documentation

License

Dual licensed under the MIT and Apache 2.0.