Fix empty VITE_API_URL falling back to localhost in production

Use ?? instead of || so empty string (same-origin) is preserved
while undefined still falls back to localhost:3001 for dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 20:50:34 -04:00
parent fbedcec4f2
commit be93e57853
+1 -1
View File
@@ -1,4 +1,4 @@
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:3001'; const API_BASE = import.meta.env.VITE_API_URL ?? 'http://localhost:3001';
let authToken: string | null = localStorage.getItem('ai-tycoon-auth-token'); let authToken: string | null = localStorage.getItem('ai-tycoon-auth-token');