From af6ab012dd75a91e7b2994927280f10c4f4c5978 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 17 Nov 2025 21:56:09 +0100 Subject: [PATCH] new ui 8 --- apps/ui/static/api-client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/ui/static/api-client.js b/apps/ui/static/api-client.js index 1217e82..f90e5d8 100644 --- a/apps/ui/static/api-client.js +++ b/apps/ui/static/api-client.js @@ -7,18 +7,19 @@ class HomeAutomationClient { constructor() { - this.baseUrl = window.API_BASE || ''; this.eventSource = null; this.eventListeners = []; } /** * Helper to construct full API URLs + * Reads window.API_BASE at runtime to support dynamic configuration * @param {string} path - API path (e.g., '/devices') * @returns {string} Full URL */ api(path) { - return `${this.baseUrl}${path}`; + const baseUrl = window.API_BASE || ''; + return `${baseUrl}${path}`; } /**