mirror of
https://github.com/tokio-rs/axum.git
synced 2025-03-26 00:27:01 +01:00
parent
66a806630c
commit
2bbf6105d0
1 changed files with 4 additions and 3 deletions
|
@ -6,7 +6,8 @@
|
|||
|
||||
use axum::{
|
||||
handler::{get, Handler},
|
||||
response::Html,
|
||||
http::StatusCode,
|
||||
response::{Html, IntoResponse},
|
||||
Router,
|
||||
};
|
||||
use std::net::SocketAddr;
|
||||
|
@ -38,6 +39,6 @@ async fn handler() -> Html<&'static str> {
|
|||
Html("<h1>Hello, World!</h1>")
|
||||
}
|
||||
|
||||
async fn handler_404() -> &'static str {
|
||||
"nothing to see here"
|
||||
async fn handler_404() -> impl IntoResponse {
|
||||
(StatusCode::NOT_FOUND, "nothing to see here")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue