finchers
finchers
is a combinator library for building HTTP services, based on Hyper and Futures.
The concept and the design of this library is highly inspired by finch
, combine
and futures
.
```rust 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 newendpoint = || { 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 in examples/
.
MIT/Apache 2.0