• Stars
    star
    9,057
  • Rank 3,766 (Top 0.08 %)
  • Language
    Rust
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

warp

crates.io Released API docs MIT licensed GHA Build Status Discord chat

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
  • Gzip, Deflate, and Brotli compression

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 = "1", features = ["full"] }
warp = "0.3"

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.

More Repositories

1

reqwest

An easy and powerful Rust HTTP Client
Rust
8,010
star
2

num_cpus

Get the number of CPUs in Rust
Rust
510
star
3

httparse

A push parser for the HTTP 1.x protocol in Rust.
Rust
499
star
4

pretty-env-logger

A pretty, easy-to-use logger for Rust.
Rust
441
star
5

intel

I need more intel!
JavaScript
200
star
6

futures-fs

Access File System operations off-thread, using a Futures.
Rust
65
star
7

unicase

Unicode Case-folding for Rust
Rust
60
star
8

spmc

Rust
55
star
9

want

Rust
33
star
10

insist

A drop-in replacement for `assert` with a better default message.
JavaScript
32
star
11

symbol

ES6 Symbols in your ES5.
JavaScript
29
star
12

vecio

Rust
27
star
13

try-lock

A lightweight lock protected by an atomic boolean.
Rust
23
star
14

hood

Cover your head. Security headers middlware
JavaScript
21
star
15

ServiceDroid

ServiceDroid is an Android application built to assist Jehovah's Witnesses doing volunteer work.
Java
20
star
16

l20n.rs

Deprecated
Rust
16
star
17

MGFX.Tabs

A simple to use Tabs plugin for MooTools.
JavaScript
15
star
18

futures-compat

A compatibility shim between futures v0.1 and v0.2.
Rust
11
star
19

tick

Rust
10
star
20

tower-h3

Rust HTTP/3 + tower Service
Rust
9
star
21

merit

Rust
9
star
22

android-browserid

Use the BrowserID protocol easily in native Android apps.
Java
9
star
23

splatmonstar

Issue tracker for tentmonstar, a Tent client on Android.
7
star
24

mocha-text-cov

text summary of code coverage for Mocha
JavaScript
6
star
25

hyper-benchmarks

Performance benchmarks for hyper.rs
4
star
26

gryphon

HTTP Request Signing with Ed25519
JavaScript
4
star
27

dbug

debug moar
JavaScript
4
star
28

cookies

Rust
3
star
29

dotfiles

These aren't the droids you're looking for.
Vim Script
3
star
30

ansi.rs

ANSI colors for Rust
Rust
2
star
31

syslogger

A sane syslog API.
JavaScript
2
star
32

relay

Rust
2
star
33

seanmonstar.github.io

HTML
1
star
34

noom

Super simple Enum types
JavaScript
1
star
35

intel-syslog

A syslog handler for intel logging.
JavaScript
1
star
36

js

Some of my JavaScript extensions
JavaScript
1
star