volga 0.6.1

Easy & Fast Web Framework for Rust
Documentation

Volga

Fast, Easy, and very flexible Web Framework for Rust based on Tokio runtime and hyper for fun and painless microservices crafting.

latest latest License: MIT Build Release

💡 Note: This project is currently in preview. Breaking changes can be introduced without prior notice.

Tutorial | API Docs | Examples | Roadmap

Features

  • Supports HTTP/1 and HTTP/2
  • Robust routing
  • Custom middlewares
  • Dependency Injection
  • WebSockets and WebTransport
  • Full Tokio compatibility
  • Runs on stable Rust 1.80+

Getting Started

Dependencies

[dependencies]
volga = "0.6.1"
tokio = { version = "1", features = ["full"] }

Simple request handler

use volga::{App, ok};

#[tokio::main]
async fn main() -> std::io::Result<()> {
    // Start the server
    let mut app = App::new();

    // Example of a request handler
    app.map_get("/hello/{name}", async |name: String| {
        ok!("Hello {name}!")
    });
    
    app.run().await
}

Performance

Tested a single instance on a laptop using 4 threads and 500 connections and under configuration:

OS: Arch Linux
CPU: Intel i7-8665U (8) @ 4.800GHz
RAM: 31686MiB

Results

Running 10s test @ http://127.0.0.1:7878/hello
  4 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.39ms    1.05ms  18.45ms   81.47%
    Req/Sec     89.69k    18.07k  126.91k   57.50%
  3575551 requests in 10.07s, 395.55MB read
Requests/sec: 355053.82
Transfer/sec: 39.28MB