Welcome to the examples! These show off warp
's functionality and explain how to use it.
hello.rs
- Just a basic "Hello World" APIrouting.rs
- Builds up a more complex set of routes and shows how to combine filtersbody.rs
- What's a good API without parsing data from the request body?headers.rs
- Parsing data from the request headersrejections.rs
- Your APIs are obviously perfect, but for silly others who call them incorrectly you'll want to define errors for themfutures.rs
- Wait, wait! ... Or how to integrate futures into filterstodos.rs
- Putting this all together with a proper app
file.rs
- Serving static filesdir.rs
- Or a whole directory of fileshandlebars_template.rs
- Using Handlebars to fill in an HTML template
Hooray! warp
also includes built-in support for WebSockets
websockets.rs
- Basic handling of a WebSocket upgradewebsockets_chat.rs
- Full WebSocket app
sse.rs
- Basic Server-Side Eventsse_chat.rs
- Full SSE app
tls.rs
- can i haz security?
autoreload.rs
- Change some code and watch the server reload automatically!
tracing.rs
- Warp has built-in support for rich diagnostics withtracing
!