17 releases

0.1.15 Apr 2, 2019
0.1.14 Mar 20, 2019
0.1.13 Feb 13, 2019
0.1.10 Dec 17, 2018
0.0.0 Mar 29, 2018

#6 in HTTP server

Download history 663/week @ 2018-12-20 211/week @ 2018-12-27 252/week @ 2019-01-03 634/week @ 2019-01-10 630/week @ 2019-01-17 750/week @ 2019-01-24 610/week @ 2019-01-31 839/week @ 2019-02-07 633/week @ 2019-02-14 638/week @ 2019-02-21 969/week @ 2019-02-28 657/week @ 2019-03-07 515/week @ 2019-03-14 820/week @ 2019-03-21 1402/week @ 2019-03-28

3,132 downloads per month
Used in 14 crates

MIT license

249KB
5.5K SLoC

warp

Travis Build Status MIT licensed crates.io Released API docs

A super-easy, composable, web server framework for warp speeds.

The fundamental building block of warp is the Filter: they can be combined and composed to express rich requirements on requests.

Thanks to its Filter system, warp provides these out of the box:

  • Path routing and parameter extraction
  • Header requirements and extraction
  • Query string deserialization
  • JSON and Form bodies
  • Static Files and Directories
  • Websockets
  • Access logging

Since it builds on top of hyper, you automatically get:

  • HTTP/1
  • HTTP/2
  • Asynchronous
  • One of the fastest HTTP implementations
  • Tested and correct

Example

use warp::{self, path, Filter};

fn main() {
    // GET /hello/warp => 200 OK with body "Hello, warp!"
    let hello = path!("hello" / String)
        .map(|name| format!("Hello, {}!", name));

    warp::serve(hello)
        .run(([127, 0, 0, 1], 3030));
}

For more information you can check the docs or the examples.

Dependencies

~9.5MB
~203K SLoC