From 67eaf500549b1d78305d55400d9a26abed98e576 Mon Sep 17 00:00:00 2001
From: Daniel Santana <danielgsantana@gmail.com>
Date: Mon, 27 Nov 2023 14:33:50 +0000
Subject: [PATCH] chore: update samples to work with nre axum

Missing sessions_axum_auth, pending PR merge.
---
 examples/errors_axum/Cargo.toml               |  22 +++++++--------
 examples/errors_axum/src/fallback.rs          |   6 ++--
 examples/errors_axum/src/main.rs              |   4 +--
 examples/hackernews_axum/Cargo.toml           |  26 +++++++++---------
 examples/hackernews_axum/src/fallback.rs      |   6 ++--
 examples/hackernews_axum/src/handlers.rs      |  13 +++++----
 examples/hackernews_axum/src/main.rs          |   4 +--
 examples/hackernews_islands_axum/Cargo.toml   |  26 +++++++++---------
 .../hackernews_islands_axum/src/fallback.rs   |   6 ++--
 .../hackernews_islands_axum/src/handlers.rs   |  12 ++++----
 examples/hackernews_islands_axum/src/main.rs  |   4 +--
 examples/session_auth_axum/src/fallback.rs    |   6 ++--
 examples/session_auth_axum/src/main.rs        |   4 +--
 examples/ssr_modes_axum/Cargo.toml            |   6 ++--
 examples/ssr_modes_axum/src/fallback.rs       |   6 ++--
 examples/ssr_modes_axum/src/main.rs           |   4 +--
 examples/todo_app_sqlite_axum/Cargo.toml      |  26 +++++++++---------
 examples/todo_app_sqlite_axum/Todos.db        | Bin 16384 -> 16384 bytes
 examples/todo_app_sqlite_axum/src/fallback.rs |   6 ++--
 examples/todo_app_sqlite_axum/src/main.rs     |   8 +++---
 integrations/axum/Cargo.toml                  |   5 +++-
 integrations/axum/src/lib.rs                  |   8 +++---
 22 files changed, 106 insertions(+), 102 deletions(-)

diff --git a/examples/errors_axum/Cargo.toml b/examples/errors_axum/Cargo.toml
index 28f48dae93..30748b1709 100644
--- a/examples/errors_axum/Cargo.toml
+++ b/examples/errors_axum/Cargo.toml
@@ -7,22 +7,22 @@ edition = "2021"
 crate-type = ["cdylib", "rlib"]
 
 [dependencies]
-console_log = "1.0.0"
-console_error_panic_hook = "0.1.7"
-cfg-if = "1.0.0"
+console_log = "1.0"
+console_error_panic_hook = "0.1"
+cfg-if = "1.0"
 leptos = { path = "../../leptos", features = ["nightly"] }
 leptos_axum = { path = "../../integrations/axum", optional = true }
 leptos_meta = { path = "../../meta" }
 leptos_router = { path = "../../router" }
-log = "0.4.17"
+log = "0.4"
 serde = { version = "1", features = ["derive"] }
-simple_logger = "4.0.0"
-axum = { version = "0.6.1", optional = true }
-tower = { version = "0.4.13", optional = true }
-tower-http = { version = "0.4", features = ["fs"], optional = true }
-tokio = { version = "1.22.0", features = ["full"], optional = true }
-http = { version = "0.2.8" }
-thiserror = "1.0.38"
+simple_logger = "4.0"
+axum = { version = "0.7", optional = true }
+tower = { version = "0.4", optional = true }
+tower-http = { version = "0.5", features = ["fs"], optional = true }
+tokio = { version = "1", features = ["full"], optional = true }
+http = { version = "1.0" }
+thiserror = "1.0"
 wasm-bindgen = "0.2"
 
 [features]
diff --git a/examples/errors_axum/src/fallback.rs b/examples/errors_axum/src/fallback.rs
index 176336beb1..ba7ae7a58f 100644
--- a/examples/errors_axum/src/fallback.rs
+++ b/examples/errors_axum/src/fallback.rs
@@ -2,7 +2,7 @@ use cfg_if::cfg_if;
 
 cfg_if! { if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::{Body},
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -28,12 +28,12 @@ cfg_if! { if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {err}"),
diff --git a/examples/errors_axum/src/main.rs b/examples/errors_axum/src/main.rs
index 4783ab6ff5..8179e5fe36 100644
--- a/examples/errors_axum/src/main.rs
+++ b/examples/errors_axum/src/main.rs
@@ -61,8 +61,8 @@ async fn main() {
     // run our app with hyper
     // `axum::Server` is a re-export of `hyper::Server`
     log!("listening on http://{}", &addr);
-    axum::Server::bind(&addr)
-        .serve(app.into_make_service())
+    let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
+    axum::serve(listener, app.into_make_service())
         .await
         .unwrap();
 }
diff --git a/examples/hackernews_axum/Cargo.toml b/examples/hackernews_axum/Cargo.toml
index 34d6e7f0a1..41b5a01bcb 100644
--- a/examples/hackernews_axum/Cargo.toml
+++ b/examples/hackernews_axum/Cargo.toml
@@ -11,24 +11,24 @@ codegen-units = 1
 lto = true
 
 [dependencies]
-console_log = "1.0.0"
-console_error_panic_hook = "0.1.7"
-cfg-if = "1.0.0"
+console_log = "1.0"
+console_error_panic_hook = "0.1"
+cfg-if = "1.0"
 leptos = { path = "../../leptos", features = ["nightly"] }
 leptos_axum = { path = "../../integrations/axum", optional = true }
 leptos_meta = { path = "../../meta", features = ["nightly"] }
 leptos_router = { path = "../../router", features = ["nightly"] }
-log = "0.4.17"
-simple_logger = "4.0.0"
-serde = { version = "1.0.148", features = ["derive"] }
+log = "0.4"
+simple_logger = "4.0"
+serde = { version = "1.0", features = ["derive"] }
 tracing = "0.1"
-gloo-net = { version = "0.2.5", features = ["http"] }
-reqwest = { version = "0.11.13", features = ["json"] }
-axum = { version = "0.6.1", optional = true }
-tower = { version = "0.4.13", optional = true }
-tower-http = { version = "0.4", features = ["fs"], optional = true }
-tokio = { version = "1.22.0", features = ["full"], optional = true }
-http = { version = "0.2.8", optional = true }
+gloo-net = { version = "0.4", features = ["http"] }
+reqwest = { version = "0.11", features = ["json"] }
+axum = { version = "0.7", optional = true }
+tower = { version = "0.4", optional = true }
+tower-http = { version = "0.5", features = ["fs"], optional = true }
+tokio = { version = "1", features = ["full"], optional = true }
+http = { version = "1.0", optional = true }
 web-sys = { version = "0.3", features = ["AbortController", "AbortSignal"] }
 wasm-bindgen = "0.2"
 
diff --git a/examples/hackernews_axum/src/fallback.rs b/examples/hackernews_axum/src/fallback.rs
index 69ec7586c2..dbdcd85ed9 100644
--- a/examples/hackernews_axum/src/fallback.rs
+++ b/examples/hackernews_axum/src/fallback.rs
@@ -3,7 +3,7 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -26,12 +26,12 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {}", err),
diff --git a/examples/hackernews_axum/src/handlers.rs b/examples/hackernews_axum/src/handlers.rs
index 4ed9ff7b28..4554b1f191 100644
--- a/examples/hackernews_axum/src/handlers.rs
+++ b/examples/hackernews_axum/src/handlers.rs
@@ -3,13 +3,14 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         http::{Request, Response, StatusCode, Uri},
+        response::IntoResponse,
     };
     use tower::ServiceExt;
     use tower_http::services::ServeDir;
 
-    pub async fn file_handler(uri: Uri) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    pub async fn file_handler(uri: Uri) -> Result<Response<Body>, (StatusCode, String)> {
         let res = get_static_file(uri.clone(), "/pkg").await?;
 
         if res.status() == StatusCode::NOT_FOUND {
@@ -24,7 +25,7 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    pub async fn get_static_file_handler(uri: Uri) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    pub async fn get_static_file_handler(uri: Uri) -> Result<Response<Body>, (StatusCode, String)> {
         let res = get_static_file(uri.clone(), "/static").await?;
 
         if res.status() == StatusCode::NOT_FOUND {
@@ -34,14 +35,14 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, base: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, base: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(&uri).body(Body::empty()).unwrap();
 
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // When run normally, the root should be the crate root
         if base == "/static" {
             match ServeDir::new("./static").oneshot(req).await {
-                Ok(res) => Ok(res.map(boxed)),
+                Ok(res) => Ok(res.into_response()),
                 Err(err) => Err((
                     StatusCode::INTERNAL_SERVER_ERROR,
                     format!("Something went wrong: {}", err),
@@ -49,7 +50,7 @@ if #[cfg(feature = "ssr")] {
         }
         } else if base == "/pkg" {
             match ServeDir::new("./pkg").oneshot(req).await {
-                Ok(res) => Ok(res.map(boxed)),
+                Ok(res) => Ok(res.into_response()),
                 Err(err) => Err((
                     StatusCode::INTERNAL_SERVER_ERROR,
                     format!("Something went wrong: {}", err),
diff --git a/examples/hackernews_axum/src/main.rs b/examples/hackernews_axum/src/main.rs
index 786fad53f4..da4db51648 100644
--- a/examples/hackernews_axum/src/main.rs
+++ b/examples/hackernews_axum/src/main.rs
@@ -32,8 +32,8 @@ if #[cfg(feature = "ssr")] {
         // run our app with hyper
         // `axum::Server` is a re-export of `hyper::Server`
         log!("listening on {}", addr);
-        axum::Server::bind(&addr)
-            .serve(app.into_make_service())
+        let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
+        axum::serve(listener, app.into_make_service())
             .await
             .unwrap();
     }
diff --git a/examples/hackernews_islands_axum/Cargo.toml b/examples/hackernews_islands_axum/Cargo.toml
index b183bc7ad2..aea1fae068 100644
--- a/examples/hackernews_islands_axum/Cargo.toml
+++ b/examples/hackernews_islands_axum/Cargo.toml
@@ -11,9 +11,9 @@ codegen-units = 1
 lto = true
 
 [dependencies]
-console_log = "1.0.0"
-console_error_panic_hook = "0.1.7"
-cfg-if = "1.0.0"
+console_log = "1.0"
+console_error_panic_hook = "0.1"
+cfg-if = "1.0"
 leptos = { path = "../../leptos", features = [
   "nightly",
   "experimental-islands",
@@ -23,20 +23,20 @@ leptos_axum = { path = "../../integrations/axum", optional = true, features = [
 ] }
 leptos_meta = { path = "../../meta", features = ["nightly"] }
 leptos_router = { path = "../../router", features = ["nightly"] }
-log = "0.4.17"
-simple_logger = "4.0.0"
-serde = { version = "1.0.148", features = ["derive"] }
+log = "0.4"
+simple_logger = "4.0"
+serde = { version = "1.0", features = ["derive"] }
 tracing = "0.1"
-gloo-net = { version = "0.2.5", features = ["http"] }
-reqwest = { version = "0.11.13", features = ["json"] }
-axum = { version = "0.6.1", optional = true, features = ["http2"] }
-tower = { version = "0.4.13", optional = true }
-tower-http = { version = "0.4", features = [
+gloo-net = { version = "0.4", features = ["http"] }
+reqwest = { version = "0.11", features = ["json"] }
+axum = { version = "0.7", optional = true, features = ["http2"] }
+tower = { version = "0.4", optional = true }
+tower-http = { version = "0.5", features = [
   "fs",
   "compression-br",
 ], optional = true }
-tokio = { version = "1.22.0", features = ["full"], optional = true }
-http = { version = "0.2.8", optional = true }
+tokio = { version = "1", features = ["full"], optional = true }
+http = { version = "1.0", optional = true }
 web-sys = { version = "0.3", features = ["AbortController", "AbortSignal"] }
 wasm-bindgen = "0.2"
 lazy_static = "1.4.0"
diff --git a/examples/hackernews_islands_axum/src/fallback.rs b/examples/hackernews_islands_axum/src/fallback.rs
index 69ec7586c2..dbdcd85ed9 100644
--- a/examples/hackernews_islands_axum/src/fallback.rs
+++ b/examples/hackernews_islands_axum/src/fallback.rs
@@ -3,7 +3,7 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -26,12 +26,12 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {}", err),
diff --git a/examples/hackernews_islands_axum/src/handlers.rs b/examples/hackernews_islands_axum/src/handlers.rs
index 4ed9ff7b28..1526447f30 100644
--- a/examples/hackernews_islands_axum/src/handlers.rs
+++ b/examples/hackernews_islands_axum/src/handlers.rs
@@ -3,13 +3,13 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         http::{Request, Response, StatusCode, Uri},
     };
     use tower::ServiceExt;
     use tower_http::services::ServeDir;
 
-    pub async fn file_handler(uri: Uri) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    pub async fn file_handler(uri: Uri) -> Result<Response<Body>, (StatusCode, String)> {
         let res = get_static_file(uri.clone(), "/pkg").await?;
 
         if res.status() == StatusCode::NOT_FOUND {
@@ -24,7 +24,7 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    pub async fn get_static_file_handler(uri: Uri) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    pub async fn get_static_file_handler(uri: Uri) -> Result<Response<Body>, (StatusCode, String)> {
         let res = get_static_file(uri.clone(), "/static").await?;
 
         if res.status() == StatusCode::NOT_FOUND {
@@ -34,14 +34,14 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, base: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, base: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(&uri).body(Body::empty()).unwrap();
 
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // When run normally, the root should be the crate root
         if base == "/static" {
             match ServeDir::new("./static").oneshot(req).await {
-                Ok(res) => Ok(res.map(boxed)),
+                Ok(res) => Ok(res.into_response()),
                 Err(err) => Err((
                     StatusCode::INTERNAL_SERVER_ERROR,
                     format!("Something went wrong: {}", err),
@@ -49,7 +49,7 @@ if #[cfg(feature = "ssr")] {
         }
         } else if base == "/pkg" {
             match ServeDir::new("./pkg").oneshot(req).await {
-                Ok(res) => Ok(res.map(boxed)),
+                Ok(res) => Ok(res.into_response()),
                 Err(err) => Err((
                     StatusCode::INTERNAL_SERVER_ERROR,
                     format!("Something went wrong: {}", err),
diff --git a/examples/hackernews_islands_axum/src/main.rs b/examples/hackernews_islands_axum/src/main.rs
index 64f75ed898..0191d06781 100644
--- a/examples/hackernews_islands_axum/src/main.rs
+++ b/examples/hackernews_islands_axum/src/main.rs
@@ -27,8 +27,8 @@ async fn main() {
     // run our app with hyper
     // `axum::Server` is a re-export of `hyper::Server`
     logging::log!("listening on {}", addr);
-    axum::Server::bind(&addr)
-        .serve(app.into_make_service())
+    let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
+    axum::serve(listener, app.into_make_service())
         .await
         .unwrap();
 }
diff --git a/examples/session_auth_axum/src/fallback.rs b/examples/session_auth_axum/src/fallback.rs
index 635d4de9dd..9eb77ac5fd 100644
--- a/examples/session_auth_axum/src/fallback.rs
+++ b/examples/session_auth_axum/src/fallback.rs
@@ -3,7 +3,7 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -29,12 +29,12 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {err}"),
diff --git a/examples/session_auth_axum/src/main.rs b/examples/session_auth_axum/src/main.rs
index 8912e2fe45..a321729fd6 100644
--- a/examples/session_auth_axum/src/main.rs
+++ b/examples/session_auth_axum/src/main.rs
@@ -100,8 +100,8 @@ if #[cfg(feature = "ssr")] {
         // run our app with hyper
         // `axum::Server` is a re-export of `hyper::Server`
         log!("listening on http://{}", &addr);
-        axum::Server::bind(&addr)
-            .serve(app.into_make_service())
+        let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
+        axum::serve(listener, app.into_make_service())
             .await
             .unwrap();
     }
diff --git a/examples/ssr_modes_axum/Cargo.toml b/examples/ssr_modes_axum/Cargo.toml
index 1c350dc959..e57730e9c6 100644
--- a/examples/ssr_modes_axum/Cargo.toml
+++ b/examples/ssr_modes_axum/Cargo.toml
@@ -18,9 +18,9 @@ leptos_router = { path = "../../router", features = ["nightly"] }
 log = "0.4"
 serde = { version = "1", features = ["derive"] }
 thiserror = "1"
-axum = { version = "0.6.1", optional = true }
-tower = { version = "0.4.13", optional = true }
-tower-http = { version = "0.4", features = ["fs"], optional = true }
+axum = { version = "0.7", optional = true }
+tower = { version = "0.4", optional = true }
+tower-http = { version = "0.5", features = ["fs"], optional = true }
 tokio = { version = "1", features = ["time"], optional = true }
 wasm-bindgen = "0.2"
 
diff --git a/examples/ssr_modes_axum/src/fallback.rs b/examples/ssr_modes_axum/src/fallback.rs
index 99403cd2ff..1d6f95333c 100644
--- a/examples/ssr_modes_axum/src/fallback.rs
+++ b/examples/ssr_modes_axum/src/fallback.rs
@@ -2,7 +2,7 @@ use cfg_if::cfg_if;
 
 cfg_if! { if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -28,12 +28,12 @@ cfg_if! { if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {err}"),
diff --git a/examples/ssr_modes_axum/src/main.rs b/examples/ssr_modes_axum/src/main.rs
index 641f76cdff..0c2b04aef5 100644
--- a/examples/ssr_modes_axum/src/main.rs
+++ b/examples/ssr_modes_axum/src/main.rs
@@ -27,8 +27,8 @@ async fn main() {
     // run our app with hyper
     // `axum::Server` is a re-export of `hyper::Server`
     log!("listening on http://{}", &addr);
-    axum::Server::bind(&addr)
-        .serve(app.into_make_service())
+    let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
+    axum::serve(listener, app.into_make_service())
         .await
         .unwrap();
 }
diff --git a/examples/todo_app_sqlite_axum/Cargo.toml b/examples/todo_app_sqlite_axum/Cargo.toml
index e60a5a63ec..a01215d397 100644
--- a/examples/todo_app_sqlite_axum/Cargo.toml
+++ b/examples/todo_app_sqlite_axum/Cargo.toml
@@ -7,27 +7,27 @@ edition = "2021"
 crate-type = ["cdylib", "rlib"]
 
 [dependencies]
-console_log = "1.0.0"
-console_error_panic_hook = "0.1.7"
-futures = "0.3.25"
-cfg-if = "1.0.0"
+console_log = "1.0"
+console_error_panic_hook = "0.1"
+futures = "0.3"
+cfg-if = "1.0"
+http = "1.0"
 leptos = { path = "../../leptos", features = ["nightly"] }
 leptos_axum = { path = "../../integrations/axum", optional = true }
 leptos_meta = { path = "../../meta", features = ["nightly"] }
 leptos_router = { path = "../../router", features = ["nightly"] }
-log = "0.4.17"
-simple_logger = "4.0.0"
+log = "0.4"
+simple_logger = "4.0"
 serde = { version = "1", features = ["derive"] }
-axum = { version = "0.6.1", optional = true }
-tower = { version = "0.4.13", optional = true }
-tower-http = { version = "0.4", features = ["fs"], optional = true }
-tokio = { version = "1.22.0", features = ["full"], optional = true }
-http = { version = "0.2.8" }
-sqlx = { version = "0.6.2", features = [
+axum = { version = "0.7", optional = true }
+tower = { version = "0.4", optional = true }
+tower-http = { version = "0.5", features = ["fs"], optional = true }
+tokio = { version = "1", features = ["full"], optional = true }
+sqlx = { version = "0.7", features = [
 	"runtime-tokio-rustls",
 	"sqlite",
 ], optional = true }
-thiserror = "1.0.38"
+thiserror = "1.0"
 wasm-bindgen = "0.2"
 
 [features]
diff --git a/examples/todo_app_sqlite_axum/Todos.db b/examples/todo_app_sqlite_axum/Todos.db
index c9e91811510280b8e0884336ca7221cd3be5151a..ec81f62b999d4d0b6675e6c5b4550d572cafc1ca 100644
GIT binary patch
delta 92
zcmZo@U~Fh$oFL68G*QNxRfs{aXu-ymx%`6sFBzElF9H$&9WXq)Sx{gzzXlf@3xgzw
gM`}(^z6B=>3xha>&B+R9mMAhXFo<t{D=(}70IYTxF#rGn

delta 65
zcmZo@U~Fh$oFL7}JyFJ)m775?+Gu0STz*~#1_oySI}H4v_+Rqh*(_*qj$e?QnT0``
VBcLchEwe<Cor#5E^ILgg1pqD^5WoNc

diff --git a/examples/todo_app_sqlite_axum/src/fallback.rs b/examples/todo_app_sqlite_axum/src/fallback.rs
index 635d4de9dd..9eb77ac5fd 100644
--- a/examples/todo_app_sqlite_axum/src/fallback.rs
+++ b/examples/todo_app_sqlite_axum/src/fallback.rs
@@ -3,7 +3,7 @@ use cfg_if::cfg_if;
 cfg_if! {
 if #[cfg(feature = "ssr")] {
     use axum::{
-        body::{boxed, Body, BoxBody},
+        body::Body,
         extract::State,
         response::IntoResponse,
         http::{Request, Response, StatusCode, Uri},
@@ -29,12 +29,12 @@ if #[cfg(feature = "ssr")] {
         }
     }
 
-    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<BoxBody>, (StatusCode, String)> {
+    async fn get_static_file(uri: Uri, root: &str) -> Result<Response<Body>, (StatusCode, String)> {
         let req = Request::builder().uri(uri.clone()).body(Body::empty()).unwrap();
         // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot`
         // This path is relative to the cargo root
         match ServeDir::new(root).oneshot(req).await {
-            Ok(res) => Ok(res.map(boxed)),
+            Ok(res) => Ok(res.into_response()),
             Err(err) => Err((
                 StatusCode::INTERNAL_SERVER_ERROR,
                 format!("Something went wrong: {err}"),
diff --git a/examples/todo_app_sqlite_axum/src/main.rs b/examples/todo_app_sqlite_axum/src/main.rs
index f4b74c8270..a21789c36e 100644
--- a/examples/todo_app_sqlite_axum/src/main.rs
+++ b/examples/todo_app_sqlite_axum/src/main.rs
@@ -10,14 +10,14 @@ cfg_if! {
         response::{IntoResponse, Response},
         Router,
     };
-    use axum::body::Body as AxumBody;
+    use axum::body::Body;
     use crate::todo::*;
     use todo_app_sqlite_axum::*;
     use crate::fallback::file_and_error_handler;
     use leptos_axum::{generate_route_list, LeptosRoutes};
 
     //Define a handler to test extractor with state
-    async fn custom_handler(Path(id): Path<String>, State(options): State<LeptosOptions>, req: Request<AxumBody>) -> Response{
+    async fn custom_handler(Path(id): Path<String>, State(options): State<LeptosOptions>, req: Request<Body>) -> Response{
             let handler = leptos_axum::render_app_to_stream_with_context(options,
             move || {
                 provide_context(id.clone());
@@ -60,9 +60,9 @@ cfg_if! {
 
         // run our app with hyper
         // `axum::Server` is a re-export of `hyper::Server`
+        let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();
         logging::log!("listening on http://{}", &addr);
-        axum::Server::bind(&addr)
-            .serve(app.into_make_service())
+        axum::serve(listener, app.into_make_service())
             .await
             .unwrap();
     }
diff --git a/integrations/axum/Cargo.toml b/integrations/axum/Cargo.toml
index 0d637e128f..ca64ca8a62 100644
--- a/integrations/axum/Cargo.toml
+++ b/integrations/axum/Cargo.toml
@@ -17,14 +17,17 @@ leptos = { workspace = true, features = ["ssr"] }
 leptos_meta = { workspace = true, features = ["ssr"] }
 leptos_router = { workspace = true, features = ["ssr"] }
 leptos_integration_utils = { workspace = true }
+parking_lot = "0.12"
 serde_json = "1"
 tokio = { version = "1", default-features = false }
-parking_lot = "0.12"
 tokio-util = { version = "0.7", features = ["rt"] }
 tracing = "0.1"
 once_cell = "1.18"
 cfg-if = "1.0"
 
+[dev-dependencies]
+tokio = { version = "1", features = ["net"] }
+
 [features]
 nonce = ["leptos/nonce"]
 wasm = []
diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs
index 020b06d261..83baaf5462 100644
--- a/integrations/axum/src/lib.rs
+++ b/integrations/axum/src/lib.rs
@@ -197,8 +197,8 @@ pub async fn generate_request_and_parts(
 ///
 ///     // run our app with hyper
 ///     // `axum::Server` is a re-export of `hyper::Server`
-///     axum::Server::bind(&addr)
-///         .serve(app.into_make_service())
+///     let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
+///     axum::serve(listener, app.into_make_service())
 ///         .await
 ///         .unwrap();
 /// }
@@ -979,8 +979,8 @@ fn provide_contexts(
 ///
 ///     // run our app with hyper
 ///     // `axum::Server` is a re-export of `hyper::Server`
-///     axum::Server::bind(&addr)
-///         .serve(app.into_make_service())
+///     let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
+///     axum::serve(listener, app.into_make_service())
 ///         .await
 ///         .unwrap();
 /// }