Our great sponsors
-
Docs Crate GitHub
-
use viz::{ types::Params, IntoResponse, IntoHandler, Request, RequestExt, Result, Response, Router, FnExt, }; async fn show_user(mut req: Request) -> Result { let Params(id) = req.extract::>().await?; Ok(format!("post {}", id).into_response()) } async fn show_user_ext(Params(id): Params) -> Result { Ok(format!("Hi, NO.{}", id)) } async fn show_user_wrap(req: Request) -> Result { // https://github.com/rust-lang/rust/issues/48919 // show_user_ext.call(req).await FnExt::call(&show_user_ext, req).await } let app = Router::new() .get("/users/:id", show_user) .get("/users_wrap/:id", show_user_wrap) .get("/users_ext/:id", show_user_ext.into_handler());
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-