File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use axum::{
77 routing:: { get, post} ,
88 Router ,
99} ;
10- use tower_http:: cors:: CorsLayer ;
10+ use tower_http:: { cors:: CorsLayer , services :: ServeDir } ;
1111use tracing_subscriber;
1212
1313mod api;
@@ -20,11 +20,11 @@ async fn main() -> Result<()> {
2020 tracing_subscriber:: fmt:: init ( ) ;
2121
2222 let app = Router :: new ( )
23- . route ( "/" , get ( handlers:: root) )
2423 . route ( "/api/health" , get ( handlers:: health) )
2524 . route ( "/api/compare" , post ( handlers:: compare) )
2625 . route ( "/api/analyze" , post ( handlers:: analyze) )
2726 . route ( "/api/configure" , post ( handlers:: configure) )
27+ . nest_service ( "/" , ServeDir :: new ( "static" ) . fallback ( handlers:: spa_fallback) )
2828 . layer ( CorsLayer :: permissive ( ) ) ;
2929
3030 let listener = tokio:: net:: TcpListener :: bind ( "0.0.0.0:3000" ) . await ?;
You can’t perform that action at this time.
0 commit comments