diff --git a/docs/content/web-frameworks.md b/docs/content/web-frameworks.md index d3e14390..a48d8ca8 100644 --- a/docs/content/web-frameworks.md +++ b/docs/content/web-frameworks.md @@ -193,13 +193,19 @@ This adds an implementation of `IntoResponse` for `Markup`/`PreEscaped`. This then allows you to use it directly as a response! ```rust,no_run -use maud::html; +use maud::{html, Markup}; use axum::prelude::*; +async fn hello_world() -> Markup { + html! { + h1 { "Hello, World!" } + } +} + #[tokio::main] async fn main() { // build our application with a single route - let app = route("/", get(|| async { html! { h1 { "Hello, World!" } } })); + let app = route("/", get(hello_world)); // run it with hyper on localhost:3000 axum::Server::bind(&"0.0.0.0:3000".parse().unwrap()) diff --git a/doctest/Cargo.toml b/doctest/Cargo.toml index 25d575ff..a06e4cf3 100644 --- a/doctest/Cargo.toml +++ b/doctest/Cargo.toml @@ -8,11 +8,13 @@ edition = "2018" actix-web = "3" ammonia = "3" iron = "0.6" -maud = { path = "../maud", features = ["actix-web", "iron", "rocket", "tide"] } +maud = { path = "../maud", features = ["actix-web", "iron", "rocket", "tide", "axum"] } pulldown-cmark = "0.8" rocket = "0.4" rouille = "3" tide = "0.16" +tokio = { version = "1.9.0", features = ["rt", "macros", "rt-multi-thread"] } +axum = "0.1.3" [dependencies.async-std] version = "1.9.0"