#hyper #wrapper #rest #idea #response #express-like #pony-builder

yanked pony

An Express-like wrapper around Hyper

11 releases

Uses old Rust 2015

0.1.10 Sep 28, 2018
0.1.9 Sep 28, 2018
0.1.8 Apr 14, 2018
0.1.7 Mar 20, 2018
0.1.2 Jan 21, 2018

#43 in #idea

39 downloads per month

MIT license

24KB
594 lines

Pony

An Express-like wrapper around Hyper

Very little has been done to abstract Hyper away from the end user. The idea being that providing a simple api for declaring rest endpoints makes developing easier.

Example

extern crate pony;
extern crate futures;
extern crate hyper;

use futures::future::ok;
use pony::PonyBuilder;
use hyper::server::Response;
use hyper::header::ContentLength;

fn main() {
    let mut pb = PonyBuilder.new();
    pb.get("/get", )
}

fn hello_world() {
    let hw = "hello world"
    Box::new(
        ok(
            Response::new()
            .with_header(ContentLength(hw.len()))
            .with_body(&hw)
        )
    )
}

Dependencies

~9MB
~156K SLoC