mingyang91 commited on
Commit
3398d37
·
verified ·
1 Parent(s): 29b35ee

update jinyu FE

Browse files

Signed-off-by: 明扬 <[email protected]>

Files changed (1) hide show
  1. src/lib.rs +7 -7
src/lib.rs CHANGED
@@ -382,12 +382,6 @@ pub async fn app(config: &SdkConfig) -> Result<(), std::io::Error> {
382
  };
383
 
384
  let app = Route::new()
385
- .nest(
386
- "/",
387
- StaticFilesEndpoint::new("./static")
388
- .show_files_listing()
389
- .index_file("index.html"),
390
- )
391
  .at("/ws/lesson-speaker", get(stream_speaker))
392
  .at("/ws/teacher", get(stream_speaker))
393
  .at("/ws/lesson-listener", get(stream_listener))
@@ -401,7 +395,13 @@ pub async fn app(config: &SdkConfig) -> Result<(), std::io::Error> {
401
  "lesson-listener",
402
  StaticFileEndpoint::new("./static/debug.html"),
403
  )
404
- .nest("/", StaticFileEndpoint::new("./static/index.html"))
 
 
 
 
 
 
405
  .data(ctx);
406
  let addr = format!("{}:{}", SETTINGS.server.host, SETTINGS.server.port);
407
  let listener = TcpListener::bind(addr);
 
382
  };
383
 
384
  let app = Route::new()
 
 
 
 
 
 
385
  .at("/ws/lesson-speaker", get(stream_speaker))
386
  .at("/ws/teacher", get(stream_speaker))
387
  .at("/ws/lesson-listener", get(stream_listener))
 
395
  "lesson-listener",
396
  StaticFileEndpoint::new("./static/debug.html"),
397
  )
398
+ .nest(
399
+ "/",
400
+ StaticFilesEndpoint::new("./static")
401
+ .show_files_listing()
402
+ .index_file("index.html")
403
+ .fallback_to_index(),
404
+ )
405
  .data(ctx);
406
  let addr = format!("{}:{}", SETTINGS.server.host, SETTINGS.server.port);
407
  let listener = TcpListener::bind(addr);