Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/ui/src/lib/http-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,12 @@ const getServerUrl = (): string => {
const envUrl = import.meta.env.VITE_SERVER_URL;
if (envUrl) return envUrl;

// In web mode (not Electron), use relative URL to leverage Vite proxy
// In web mode (not Electron), use relative URL to leverage nginx proxy
// This avoids CORS issues since requests appear same-origin
if (!window.electron) {
// Note: Using 'in' operator prevents Vite from tree-shaking this branch,
// as it cannot statically determine the result at build time
const isElectron = 'electron' in window && window.electron != null;
if (!isElectron) {
return '';
}
}
Expand Down