mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
Fix content-type in example response (#276)
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
//! cargo run -p example-hello-world
|
//! cargo run -p example-hello-world
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
use axum::{handler::get, Router};
|
use axum::{handler::get, response::Html, Router};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -21,6 +21,6 @@ async fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handler() -> &'static str {
|
async fn handler() -> Html<&'static str> {
|
||||||
"<h1>Hello, World!</h1>"
|
Html("<h1>Hello, World!</h1>")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user