Envoy is a minimal and pragmatic Rust web application framework built for rapid development. It comes with a robust set of features that make building async web applications and APIs easier and more fun.
Getting started
In order to build a web app in Rust you need an HTTP server, and an async
runtime. After running cargo init add the following lines to your
Cargo.toml file:
# Example, use the version numbers you need
= "0.16.0"
= { = "1.8.0", = ["attributes"] }
= { = "1.0", = ["derive"] }
Examples
Create an HTTP server that receives a JSON body, validates it, and responds with a confirmation message.
use Context;
use *;
async
async
Hello, Chashu! I've put in an order for 4 shoes
Hello, Mary Millipede! I've put in an order for 750 shoes
See more examples in the examples directory.
Envoy's design:
- Rising Envoy: building a modular web framework in the open
- Routing and extraction in Envoy: a first sketch
- Middleware in Envoy
- Envoy's evolving middleware approach
- Envoy, the present and future of
- Envoy channels
Community Resources
To add a link to this list, edit the markdown file and submit a pull request (github login required)Listing here does not constitute an endorsement or recommendation from the envoy team. Use at your own risk.
Listeners
- envoy-rustls TLS for envoy based on async-rustls
- envoy-acme HTTPS for envoy with automatic certificates, via Let's Encrypt and ACME tls-alpn-01 challenges
Template engines
- envoy-tera
- envoy-handlebars
- askama (includes support for envoy)
Routers
Auth
Testing
Middleware
- envoy-compress
- envoy-sqlx - SQLx pooled connections & transactions
- envoy-trace
- envoy-tracing
- opentelemetry-envoy
- driftwood http logging middleware
- envoy-compressed-sse
- envoy-websockets
- envoy-csrf
Session Stores
- async-redis-session
- async-sqlx-session (sqlite, mysql, postgres, ...)
- async-mongodb-session
Example applications
- dot dot vote
- envoy-example (sqlx + askama)
- playground-envoy-mongodb
- envoy-morth-example
- broker (backend as a service)
- envoy-basic-crud (sqlx + tera)
- envoy-graphql-mongodb
- Clean boilerplate for graphql services using envoy, rhai, async-graphql, surf, graphql-client, handlebars-rust, jsonwebtoken, and mongodb.
- Graphql Services: User register, Salt and hash a password with PBKDF2 , Sign in, JSON web token authentication, Change password, Profile Update, User's query & mutation, and Project's query & mutation.
- Web Application: Client request, bring & parse GraphQL data, Render data to template engine(handlebars-rust), Define custom helper with Rhai scripting language.
- surfer
- The Blog built on Envoy stack, generated from envoy-graphql-mongodb.
- Backend for graphql services using envoy, async-graphql, jsonwebtoken, mongodb and so on.
- Frontend for web application using envoy, rhai, surf, graphql_client, handlebars-rust, cookie and so on.
- envoy-server-example
Contributing
Want to join us? Check out our The "Contributing" section of the guide and take a look at some of these issues:
Conduct
The Envoy project adheres to the Contributor Covenant Code of Conduct. This describes the minimum behavior expected from all contributors.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.