63 releases

0.9.0 Oct 3, 2024
0.8.8 Jun 23, 2024
0.8.5 May 28, 2024
0.8.4 Mar 23, 2024
0.1.0-alpha Jun 28, 2020

#578 in Web programming

Download history 231/week @ 2024-07-23 393/week @ 2024-07-30 88/week @ 2024-08-06 40/week @ 2024-08-13 100/week @ 2024-08-20 174/week @ 2024-08-27 349/week @ 2024-09-03 214/week @ 2024-09-10 219/week @ 2024-09-17 374/week @ 2024-09-24 345/week @ 2024-10-01 185/week @ 2024-10-08 136/week @ 2024-10-15 167/week @ 2024-10-22 118/week @ 2024-10-29 294/week @ 2024-11-05

738 downloads per month
Used in 3 crates

MIT license

290KB
7K SLoC

Viz

Fast, robust, flexible, lightweight web framework for Rust

Features

  • Safety #![forbid(unsafe_code)]

  • Lightweight

  • Robust Routing

  • Handy Extractors

  • Simple + Flexible Handler & Middleware

  • Supports Tower Service

Hello Viz

use std::net::SocketAddr;
use tokio::net::TcpListener;
use viz::{serve, Request, Result, Router};

async fn index(_: Request) -> Result<&'static str> {
    Ok("Hello, Viz!")
}

#[tokio::main]
async fn main() -> Result<()> {
    let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
    let listener = TcpListener::bind(addr).await?;
    println!("listening on http://{addr}");

    let app = Router::new().get("/", index);

    if let Err(e) = serve(listener, app).await {
        println!("{e}");
    }

    Ok(())
}

More examples can be found here.

Get started

Open Viz.rs, select language or version.

License

This project is licensed under the MIT license.

Author

Dependencies

~7–21MB
~353K SLoC