viz-router

Crates.ioviz-router
lib.rsviz-router
version0.8.8
sourcesrc
created_at2020-06-28 00:41:45.99263
updated_at2024-06-23 10:10:28.005442
descriptionThe router for Viz
homepagehttps://viz.rs
repositoryhttps://github.com/viz-rs/viz
max_upload_size
id258956
size48,734
Fangdun Tsai (fundon)

documentation

https://docs.rs/viz-router

README

Viz

Robust Routing for Viz

Safety! Docs.rs docs Crates.io version Download

Example

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));

License

This project is licensed under the MIT license.

Author

Commit count: 458

cargo fmt