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:
@@ -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');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user