27 releases

✓ Uses Rust 2018 edition

0.2.2 Mar 3, 2020
0.1.22 Mar 16, 2020
0.1.20 Sep 18, 2019
0.1.18 Jul 26, 2019
0.0.0 Mar 29, 2018

#3 in HTTP server

Download history 5618/week @ 2019-12-10 4344/week @ 2019-12-17 1807/week @ 2019-12-24 2364/week @ 2019-12-31 4258/week @ 2020-01-07 5108/week @ 2020-01-14 7506/week @ 2020-01-21 8151/week @ 2020-01-28 7594/week @ 2020-02-04 8058/week @ 2020-02-11 8043/week @ 2020-02-18 10691/week @ 2020-02-25 11016/week @ 2020-03-03 12422/week @ 2020-03-10 13414/week @ 2020-03-17 13006/week @ 2020-03-24

29,849 downloads per month
Used in 55 crates (49 directly)

MIT license

270KB
6K SLoC

warp

GHA 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

Add warp and Tokio to your dependencies:

tokio = { version = "0.2", features = ["macros"] }
warp = "0.2"

And then get started in your main.rs:

use warp::Filter;

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

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

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

Dependencies

~9–12MB
~265K SLoC