@@ -39,8 +39,8 @@ impl UiConfig {
39
39
pub fn ui_server_router ( port : u16 ) -> Router {
40
40
Router :: new ( )
41
41
. route ( "/index.html" , get ( index_html) )
42
- . route ( "/dist/main/swimos -transit.js" , get ( transit_js) )
43
- . route ( "/dist/main/swimos -transit.js.map" , get ( transit_js_map) )
42
+ . route ( "/dist/main/swim -transit.js" , get ( transit_js) )
43
+ . route ( "/dist/main/swim -transit.js.map" , get ( transit_js_map) )
44
44
. with_state ( UiConfig { port } )
45
45
}
46
46
@@ -49,7 +49,7 @@ const INDEX: &str = "ui/index.html";
49
49
async fn index_html ( State ( UiConfig { port } ) : State < UiConfig > ) -> impl IntoResponse {
50
50
if let Ok ( file) = File :: open ( INDEX ) . await {
51
51
let lines = LinesStream :: new ( BufReader :: new ( file) . lines ( ) ) . map_ok ( move |mut line| {
52
- if line == "const portParam = baseUri.port();" {
52
+ if line. contains ( "const portParam = baseUri.port();" ) {
53
53
format ! ( "const portParam = {};\n " , port)
54
54
} else {
55
55
line. push ( '\n' ) ;
@@ -78,15 +78,15 @@ async fn index_html(State(UiConfig { port }): State<UiConfig>) -> impl IntoRespo
78
78
79
79
async fn transit_js ( ) -> impl IntoResponse {
80
80
let headers = [ ( header:: CONTENT_TYPE , JS . clone ( ) ) ] ;
81
- ( headers, load_file ( "dist/main/swimos -transit.js" ) . await )
81
+ ( headers, load_file ( "dist/main/swim -transit.js" ) . await )
82
82
}
83
83
84
84
static HTML : HeaderValue = HeaderValue :: from_static ( "text/html; charset=utf-8" ) ;
85
85
static JS : HeaderValue = HeaderValue :: from_static ( "application/json" ) ;
86
86
87
87
async fn transit_js_map ( ) -> impl IntoResponse {
88
88
let headers = [ ( header:: CONTENT_TYPE , JS . clone ( ) ) ] ;
89
- ( headers, load_file ( "dist/main/swimos -transit.js.map" ) . await )
89
+ ( headers, load_file ( "dist/main/swim -transit.js.map" ) . await )
90
90
}
91
91
92
92
async fn load_file ( path : & str ) -> impl IntoResponse {
0 commit comments