mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-14 00:00:15 +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
|
||||
let app = Router::new()
|
||||
.nest("/", static_files_service)
|
||||
.fallback(static_files_service)
|
||||
.route("/sse", get(sse_handler))
|
||||
.layer(TraceLayer::new_for_http());
|
||||
|
||||
|
||||
@@ -33,8 +33,7 @@ async fn main() {
|
||||
|
||||
// build our application with some routes
|
||||
let app = Router::new()
|
||||
.nest(
|
||||
"/",
|
||||
.fallback(
|
||||
service::get(
|
||||
ServeDir::new("examples/websockets/assets").append_index_html_on_directories(true),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user