mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-01 00:00:14 +02:00
update examples
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
handler::Handler,
|
||||
http::StatusCode,
|
||||
response::{Html, IntoResponse},
|
||||
routing::get,
|
||||
@@ -24,10 +23,10 @@ async fn main() {
|
||||
.init();
|
||||
|
||||
// build our application with a route
|
||||
let app = Router::new().route("/", get(handler));
|
||||
let app = Router::without_state().route("/", get(handler));
|
||||
|
||||
// add a fallback service for handling routes to unknown paths
|
||||
let app = app.fallback(handler_404.into_service());
|
||||
let app = app.fallback(handler_404);
|
||||
|
||||
// run it
|
||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||
|
||||
Reference in New Issue
Block a user