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 -2
View File
@@ -24,7 +24,7 @@ async fn main() {
let client = Client::new();
let app = Router::new()
let app = Router::without_state()
.route("/", get(handler))
.layer(Extension(client));
@@ -57,7 +57,7 @@ async fn handler(
}
async fn server() {
let app = Router::new().route("/", get(|| async { "Hello, world!" }));
let app = Router::without_state().route("/", get(|| async { "Hello, world!" }));
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
println!("server listening on {}", addr);