mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-01 00:00:14 +02:00
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
use axum::{
|
use axum::{
|
||||||
handler::{get, Handler},
|
handler::{get, Handler},
|
||||||
response::Html,
|
http::StatusCode,
|
||||||
|
response::{Html, IntoResponse},
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
@@ -38,6 +39,6 @@ async fn handler() -> Html<&'static str> {
|
|||||||
Html("<h1>Hello, World!</h1>")
|
Html("<h1>Hello, World!</h1>")
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handler_404() -> &'static str {
|
async fn handler_404() -> impl IntoResponse {
|
||||||
"nothing to see here"
|
(StatusCode::NOT_FOUND, "nothing to see here")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user