mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Fix sse and ws examples (#429)
* Fix sse example * Fix websockets example
This commit is contained in:
@@ -36,7 +36,7 @@ async fn main() {
|
|||||||
|
|
||||||
// build our application with a route
|
// build our application with a route
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.nest("/", static_files_service)
|
.fallback(static_files_service)
|
||||||
.route("/sse", get(sse_handler))
|
.route("/sse", get(sse_handler))
|
||||||
.layer(TraceLayer::new_for_http());
|
.layer(TraceLayer::new_for_http());
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ async fn main() {
|
|||||||
|
|
||||||
// build our application with some routes
|
// build our application with some routes
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.nest(
|
.fallback(
|
||||||
"/",
|
|
||||||
service::get(
|
service::get(
|
||||||
ServeDir::new("examples/websockets/assets").append_index_html_on_directories(true),
|
ServeDir::new("examples/websockets/assets").append_index_html_on_directories(true),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user