1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-04-26 13:56:22 +02:00

Fix content-type in example response ()

This commit is contained in:
Ken-Miura 2021-08-27 03:16:41 +09:00 committed by GitHub
parent bdc39deef2
commit e6ca9e4b04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
//! cargo run -p example-hello-world
//! ```
use axum::{handler::get, Router};
use axum::{handler::get, response::Html, Router};
use std::net::SocketAddr;
#[tokio::main]
@ -21,6 +21,6 @@ async fn main() {
.unwrap();
}
async fn handler() -> &'static str {
"<h1>Hello, World!</h1>"
async fn handler() -> Html<&'static str> {
Html("<h1>Hello, World!</h1>")
}