use tide::{self, Body, Request, Response, StatusCode}; use tide_auth::{Auth, AuthValue, Basic}; #[async_std::main] async fn main() -> Result<(), std::io::Error> { tide::log::start(); let mut app = tide::new(); let auth: Auth = Basic::new("Hello").into(); app.with(auth); app.at("/").get(|r: Request<()>| async move { let user = r.ext::(); Ok(format!("{:?}", user)) }); app.listen("127.0.0.1:8080").await?; Ok(()) }