Skip to content

Commit 6cbbdfb

Browse files
committed
fix env url
1 parent 0a79be1 commit 6cbbdfb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/lib/config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// Backend API configuration
2-
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
2+
// Use environment var if provided; otherwise default to same-origin
3+
const ENV_API_BASE_URL = import.meta.env.VITE_API_BASE_URL as string | undefined;
4+
export const API_BASE_URL = (ENV_API_BASE_URL && ENV_API_BASE_URL.trim() !== "")
5+
? ENV_API_BASE_URL
6+
: window.location.origin;
37

48

59
// API endpoints

0 commit comments

Comments
 (0)