finchers 0.12.0-alpha.6

A combinator library for builidng asynchronous HTTP services
docs.rs failed to build finchers-0.12.0-alpha.6
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: finchers-0.13.5

A combinator library for building asynchronous HTTP services.

The concept and design was highly inspired by finch.

Features

  • Asynchronous handling powerd by futures and Tokio
  • Building an HTTP service by combining the primitive components
  • Type-safe routing without (unstable) procedural macros

Example

use finchers::prelude::*;
use finchers::path;

fn main() {
    let get_post = path!(@get / u64 /)
        .map(|id: u64| format!("GET: id={}", id));

    let create_post = path!(@post /)
        .and(endpoints::body::text())
        .map(|data: String| format!("POST: body={}", data));

    let post_api = path!(/ "posts")
        .and(get_post.or(create_post));

# std::mem::drop(move || {
    finchers::launch(post_api)
        .start("127.0.0.1:4000")
# });
}