13 releases

new 0.1.11 Jan 14, 2019
0.1.10 Dec 17, 2018
0.1.9 Oct 31, 2018
0.1.4 Sep 26, 2018
0.0.0 Mar 29, 2018

#12 in HTTP server

Download history 435/week @ 2018-10-25 919/week @ 2018-11-01 643/week @ 2018-11-08 543/week @ 2018-11-15 407/week @ 2018-11-22 451/week @ 2018-11-29 485/week @ 2018-12-06 625/week @ 2018-12-13 1074/week @ 2018-12-20 621/week @ 2018-12-27 174/week @ 2019-01-03 336/week @ 2019-01-10 573/week @ 2019-01-17

2,428 downloads per month
Used in 8 crates

MIT license

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

#[macro_use]
extern crate warp;

use warp::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

~13MB
~319K SLoC