We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ffb63fe + 0c0e1a7 commit b35206bCopy full SHA for b35206b
frontend/src/api.ts
@@ -1,7 +1,9 @@
1
import axios from 'axios';
2
3
-// Use the same host as the frontend (works for both localhost and LAN access)
4
-const API_BASE_URL = `http://${window.location.hostname}:8000`;
+// Use same origin for reverse proxy setups, fallback to :8000 for dev/Docker
+const API_BASE_URL = import.meta.env.DEV
5
+ ? `http://${window.location.hostname}:8000` // Dev mode: explicit port 8000
6
+ : `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}`; // Production: same origin
7
8
export interface Job {
9
id: string;
0 commit comments