mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-07-27 07:35:22 +00:00
Explicit tauri solution to base url
This commit is contained in:
parent
7a68e5c27a
commit
8c1642ce87
@ -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}`;
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user