gecko-dev/third_party/rust/warp/examples
..
dir
tls
README.md
autoreload.rs
body.rs
dir.rs
dyn_reply.rs
file.rs
futures.rs
handlebars_template.rs
headers.rs
hello.rs
rejections.rs
returning.rs
routing.rs
sse.rs
sse_chat.rs
tls.rs
todos.rs
unix_socket.rs
websockets.rs
websockets_chat.rs

README.md

Examples

Welcome to the examples! These show off warp's functionality and explain how to use it.

Getting Started

  • hello.rs - Just a basic "Hello World" API
  • routing.rs - Builds up a more complex set of routes and shows how to combine filters
  • body.rs - What's a good API without parsing data from the request body?
  • headers.rs - Parsing data from the request headers
  • rejections.rs - Your APIs are obviously perfect, but for silly others who call them incorrectly you'll want to define errors for them
  • futures.rs - Wait, wait! ... Or how to integrate futures into filters
  • todos.rs - Putting this all together with a proper app

Further Use Cases

Serving HTML and Other Files

Websockets

Hooray! warp also includes built-in support for WebSockets

Server-Side Events

TLS

  • tls.rs - can i haz security?

Autoreloading

  • autoreload.rs - Change some code and watch the server reload automatically!