Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viz-rs/viz
Fast, flexible, lightweight web framework for Rust
https://github.com/viz-rs/viz
framework rust viz web
Last synced: 3 months ago
JSON representation
Fast, flexible, lightweight web framework for Rust
- Host: GitHub
- URL: https://github.com/viz-rs/viz
- Owner: viz-rs
- License: mit
- Created: 2020-04-06T10:16:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T03:37:26.000Z (6 months ago)
- Last Synced: 2024-05-29T15:38:31.203Z (6 months ago)
- Topics: framework, rust, viz, web
- Language: Rust
- Homepage: https://viz.rs
- Size: 1.93 MB
- Stars: 313
- Watchers: 6
- Forks: 15
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
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
```rust
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](https://github.com/viz-rs/viz/tree/main/examples).## Get started
Open [Viz.rs](https://viz.rs), select language or version.
## License
This project is licensed under the [MIT license](LICENSE).
## Author
- [@[email protected]](https://fosstodon.org/@fundon)
- [@\_fundon](https://twitter.com/_fundon)