Introduction
XEO is a high-performance web framework for Rust, designed to be secure by default without sacrificing speed.
Why XEO?
Rust web frameworks often force you to choose between compile-time safety and developer ergonomics. XEO aims to solve this by providing a familiar API (inspired by Express and Axum) while enforcing strict security policies at the type level.
- Safety: Automatic protection against path traversal and injection attacks.
- Speed: Built on top of Hyper, achieving industry-leading throughput.
- Simplicity: No complex macros or boilerplate required to get started.
Installation
Add XEO to your Cargo.toml file:
[dependencies]
xeo = "1.0.0"
tokio = { version = "1", features = ["full"] }
Basic Usage
Here is a minimal example of an XEO application:
use xeo::prelude::*;
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(|| async { "Hello World" }));
Server::bind("0.0.0.0:3000")
.serve(app)
.await
.unwrap();
}