Crate volga

Source
Expand description

§Volga

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

§Features

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

§Example

[dependencies]
volga = "0.4.8"
tokio = { version = "1", features = ["full"] }
use volga::*;
 
#[tokio::main]
async fn main() -> std::io::Result<()> {
    // Start the server
    let mut app = App::new();
 
    // Example of request handler
    app.map_get("/hello/{name}", |name: String| async move {
         ok!("Hello {name}!")
    });
     
    app.run().await
}

Re-exports§

Modules§

Macros§

  • Produces HTTP 400 BAD REQUEST response
  • Creates a default HTTP response builder
  • Declares a custom HTTP headers
  • Produces OK 200 response with file body
  • Produces OK 200 response with Form Data body
  • Creates HTTP Request/Response headers
  • Produces HTTP 404 NOT FOUND response
  • Produces an OK 200 response with plain text or JSON body
  • Produces HTTP 308 PERMANENT REDIRECT response
  • Produces HTTP 301 MOVED PERMANENTLY response
  • Creates an HTTP response with status, body and headers
  • Produces a response with specified StatusCode with plain text or JSON body
  • Produces OK 200 response with stream body
  • Produces HTTP 307 TEMPORARY REDIRECT response