Skip to content

Commit 7ee4201

Browse files
authored
Merge branch 'main' into ws-protocol
2 parents 2226149 + 17eb6dc commit 7ee4201

File tree

1 file changed

+5
-5
lines changed
  • example_apps/transit/src

1 file changed

+5
-5
lines changed

example_apps/transit/src/ui.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ impl UiConfig {
3939
pub fn ui_server_router(port: u16) -> Router {
4040
Router::new()
4141
.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))
4444
.with_state(UiConfig { port })
4545
}
4646

@@ -49,7 +49,7 @@ const INDEX: &str = "ui/index.html";
4949
async fn index_html(State(UiConfig { port }): State<UiConfig>) -> impl IntoResponse {
5050
if let Ok(file) = File::open(INDEX).await {
5151
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();") {
5353
format!("const portParam = {};\n", port)
5454
} else {
5555
line.push('\n');
@@ -78,15 +78,15 @@ async fn index_html(State(UiConfig { port }): State<UiConfig>) -> impl IntoRespo
7878

7979
async fn transit_js() -> impl IntoResponse {
8080
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)
8282
}
8383

8484
static HTML: HeaderValue = HeaderValue::from_static("text/html; charset=utf-8");
8585
static JS: HeaderValue = HeaderValue::from_static("application/json");
8686

8787
async fn transit_js_map() -> impl IntoResponse {
8888
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)
9090
}
9191

9292
async fn load_file(path: &str) -> impl IntoResponse {

0 commit comments

Comments
 (0)