Spaces:
Running
Running
Numan Saeed
commited on
Commit
·
6e47663
1
Parent(s):
158211c
Fix: Use same-origin API for HuggingFace Spaces
Browse files- frontend/src/lib/api.ts +1 -1
frontend/src/lib/api.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
const API_BASE = 'http://localhost:8000';
|
| 2 |
|
| 3 |
export interface ClassificationResult {
|
| 4 |
label: string;
|
|
|
|
| 1 |
+
const API_BASE = typeof window !== 'undefined' && window.location.hostname === 'localhost' ? 'http://localhost:8000' : '';
|
| 2 |
|
| 3 |
export interface ClassificationResult {
|
| 4 |
label: string;
|