update examples

This commit is contained in:
David Pedersen
2022-07-03 21:47:23 +02:00
parent 02f9ebaee9
commit 16ef59b6ce
38 changed files with 101 additions and 83 deletions
+2 -3
View File
@@ -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));