summaryrefslogtreecommitdiffhomepage
path: root/src/app/resolve-http-url.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-27 01:13:28 +0900
committerAdam Malczewski <[email protected]>2026-06-27 01:13:31 +0900
commit0a271e3e8aecb1ec9db3eea873b3df1ecaab8b99 (patch)
tree0a5a6e62acf2d8e15ec69fd09f641cd75a1bcb10 /src/app/resolve-http-url.ts
parent397ce9b65b888121d8c7e909c37dfdbffe914673 (diff)
parent576f539670f406280f8398abf78a867d70b683b8 (diff)
downloaddispatch-web-0a271e3e8aecb1ec9db3eea873b3df1ecaab8b99.tar.gz
dispatch-web-0a271e3e8aecb1ec9db3eea873b3df1ecaab8b99.zip
Merge branch 'dev' into feature/heartbeat
# Conflicts: # src/app/App.svelte # src/app/store.svelte.ts # src/app/store.test.ts # src/features/workspaces/ui/WorkspaceCard.test.ts
Diffstat (limited to 'src/app/resolve-http-url.ts')
-rw-r--r--src/app/resolve-http-url.ts30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/app/resolve-http-url.ts b/src/app/resolve-http-url.ts
index 357d2fc..1e20eb2 100644
--- a/src/app/resolve-http-url.ts
+++ b/src/app/resolve-http-url.ts
@@ -1,28 +1,28 @@
export interface HttpUrlEnv {
- readonly VITE_HTTP_URL?: string;
- readonly VITE_HTTP_PORT?: string;
+ readonly VITE_HTTP_URL?: string;
+ readonly VITE_HTTP_PORT?: string;
}
export interface HttpUrlLocation {
- readonly protocol: string;
- readonly hostname: string;
+ readonly protocol: string;
+ readonly hostname: string;
}
const DEFAULT_PORT = "24203";
const DEFAULT_FALLBACK = "http://localhost:24203";
export function resolveHttpUrl(env: HttpUrlEnv, location?: HttpUrlLocation): string {
- if (env.VITE_HTTP_URL !== undefined && env.VITE_HTTP_URL !== "") {
- return env.VITE_HTTP_URL;
- }
+ if (env.VITE_HTTP_URL !== undefined && env.VITE_HTTP_URL !== "") {
+ return env.VITE_HTTP_URL;
+ }
- if (location === undefined) {
- return DEFAULT_FALLBACK;
- }
+ if (location === undefined) {
+ return DEFAULT_FALLBACK;
+ }
- const port =
- env.VITE_HTTP_PORT !== undefined && env.VITE_HTTP_PORT !== ""
- ? env.VITE_HTTP_PORT
- : DEFAULT_PORT;
- return `${location.protocol}//${location.hostname}:${port}`;
+ const port =
+ env.VITE_HTTP_PORT !== undefined && env.VITE_HTTP_PORT !== ""
+ ? env.VITE_HTTP_PORT
+ : DEFAULT_PORT;
+ return `${location.protocol}//${location.hostname}:${port}`;
}