Skip to content

Commit

Permalink
doc(examples): replace nested_service by fallback_service (#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore authored Jan 15, 2025
1 parent e47353d commit 1f57e8f
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/angular-todomvc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-crud-application/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/private-messaging/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
);

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/redis-whiteboard/src/fred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
io.ns("/", on_connect).await?;

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
4 changes: 2 additions & 2 deletions examples/redis-whiteboard/src/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use socketioxide::{
extract::{Data, SocketRef},
ParserConfig, SocketIo,
};
use socketioxide_redis::{RedisAdapter, RedisAdapterCtr};
use socketioxide_redis::drivers::redis::redis_client as redis;
use socketioxide_redis::{RedisAdapter, RedisAdapterCtr};
use tower::ServiceBuilder;
use tower_http::{cors::CorsLayer, services::ServeDir};
use tracing::info;
Expand Down Expand Up @@ -43,7 +43,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
io.ns("/", on_connect).await?;

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/redis-whiteboard/src/redis_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
io.ns("/", on_connect).await?;

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/webrtc-node-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});

let app = axum::Router::new()
.nest_service("/", ServeDir::new("public"))
.fallback_service(ServeDir::new("public"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down
2 changes: 1 addition & 1 deletion examples/whiteboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
});

let app = axum::Router::new()
.nest_service("/", ServeDir::new("dist"))
.fallback_service(ServeDir::new("dist"))
.layer(
ServiceBuilder::new()
.layer(CorsLayer::permissive()) // Enable CORS policy
Expand Down

0 comments on commit 1f57e8f

Please sign in to comment.