24 releases

✓ Uses Rust 2018 edition

0.2.1 Jan 23, 2020
0.1.20 Sep 18, 2019
0.1.18 Jul 26, 2019
0.1.14 Mar 20, 2019
0.0.0 Mar 29, 2018

#4 in HTTP server

Download history 4169/week @ 2019-11-07 3597/week @ 2019-11-14 3764/week @ 2019-11-21 2993/week @ 2019-11-28 4234/week @ 2019-12-05 5463/week @ 2019-12-12 2990/week @ 2019-12-19 1724/week @ 2019-12-26 3405/week @ 2020-01-02 3876/week @ 2020-01-09 6737/week @ 2020-01-16 7434/week @ 2020-01-23 7974/week @ 2020-01-30 7915/week @ 2020-02-06 7522/week @ 2020-02-13

17,023 downloads per month
Used in 44 crates (38 directly)

MIT license

275KB
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

~11MB
~246K SLoC