Crates.io | viz |
lib.rs | viz |
version | |
source | src |
created_at | 2020-04-06 09:40:11.644731 |
updated_at | 2024-10-03 05:59:53.776274 |
description | Fast, robust, flexible, lightweight web framework for Rust |
homepage | https://viz.rs |
repository | https://github.com/viz-rs/viz |
max_upload_size | |
id | 226833 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Fast, robust, flexible, lightweight web framework for Rust
Safety #![forbid(unsafe_code)]
Lightweight
Robust Routing
Handy Extractors
Simple + Flexible Handler
& Middleware
Supports Tower Service
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.
Open Viz.rs, select language or version.
This project is licensed under the MIT license.