22 releases

0.1.20 Sep 18, 2019
0.1.18 Jul 26, 2019
0.1.14 Mar 20, 2019
0.1.10 Dec 17, 2018
0.0.0 Mar 29, 2018

#6 in HTTP server

Download history 1363/week @ 2019-06-05 1377/week @ 2019-06-12 1375/week @ 2019-06-19 1640/week @ 2019-06-26 1659/week @ 2019-07-03 1729/week @ 2019-07-10 1685/week @ 2019-07-17 1518/week @ 2019-07-24 1066/week @ 2019-07-31 2060/week @ 2019-08-07 1841/week @ 2019-08-14 1984/week @ 2019-08-21 1794/week @ 2019-08-28 1977/week @ 2019-09-04 1828/week @ 2019-09-11

7,250 downloads per month
Used in 26 crates (24 directly)

MIT license

265KB
6K 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
  • Multipart form data
  • 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

~9MB
~192K SLoC