Thanks to visit codestin.com
Credit goes to github.com

Skip to content

viz-rs/vidi

Repository files navigation

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 Vidi

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

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

#[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 Vidi, select language or version.

License

This project is licensed under the MIT license.

Author

About

Fast, flexible, lightweight web framework for Rust

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 5