This commit is contained in:
2025-11-17 21:56:09 +01:00
parent a2c2ef7ddd
commit af6ab012dd

View File

@@ -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}`;
}
/**