From 8c1642ce87b18bbef53bc141f942ba7289ca1635 Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Tue, 22 Jul 2025 16:39:23 +0100 Subject: [PATCH] Explicit tauri solution to base url --- frontend/src/utils/api.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/utils/api.ts b/frontend/src/utils/api.ts index b2c6fd65f..c9eb6cd0b 100644 --- a/frontend/src/utils/api.ts +++ b/frontend/src/utils/api.ts @@ -8,7 +8,15 @@ declare global { } export const makeApiUrl = (endpoint: string): string => { - const baseUrl = window.runtimeConfig?.apiBaseUrl || 'http://localhost:8080'; - // For production, combine base URL with endpoint - return `${baseUrl}${endpoint}`; + + //const baseUrl = window.runtimeConfig?.apiBaseUrl || 'http://localhost:8080'; + + if (typeof window !== 'undefined' && (window.__TAURI__ || window.__TAURI_INTERNALS__)) { + // If running in Tauri, use the Tauri API base URL + const tauriApiBaseUrl = 'http://localhost:8080'; + return `${tauriApiBaseUrl}${endpoint}`; + } + + + return `${endpoint}`; }; \ No newline at end of file