Crates.io | viz-router |
lib.rs | viz-router |
version | 0.8.8 |
source | src |
created_at | 2020-06-28 00:41:45.99263 |
updated_at | 2024-06-23 10:10:28.005442 |
description | The router for Viz |
homepage | https://viz.rs |
repository | https://github.com/viz-rs/viz |
max_upload_size | |
id | 258956 |
size | 48,734 |
Robust Routing for Viz
use viz_core::{IntoHandler, IntoResponse, Response, Result, Request};
use viz_router::{get, Router};
async fn index() -> Result<impl IntoResponse> {
Ok(())
}
async fn ws(_: Request) -> Result<Response> {
Ok(())
}
let app = Router::new()
.route("/", get(index.into_handler()))
.route("/ws/:name", get(ws));
This project is licensed under the MIT license.