From cc56e5b22e27921758b8816b93ab78a61d25e673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 28 Jun 2022 17:15:27 +0200 Subject: [PATCH] Web: auto-detect whether the port number should be overridden It's a bit clumsy (if the web port is :8081, override it to :8080 for the API requests), but works in our case. --- web/app/src/urls.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/src/urls.js b/web/app/src/urls.js index ade7ea5c..e47f3e52 100644 --- a/web/app/src/urls.js +++ b/web/app/src/urls.js @@ -2,7 +2,9 @@ let url = new URL(window.location.href); // Uncomment this when the web interface is running on a different port than the // API, for example when using the Vite devserver. Set the API port here. -// url.port = "8080"; +if (url.port == "8081") { + url.port = "8080"; +} url.pathname = "/"; const flamencoAPIURL = url.href;