Spaces:
Running
Running
Commit ·
abd0b64
1
Parent(s): b2ffd25
Remove Hugging Face Spaces base prefix for API routes
Browse files- frontend/src/api/client.js +1 -11
frontend/src/api/client.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
| 1 |
-
const BASE =
|
| 2 |
-
if (typeof window === 'undefined') return ''
|
| 3 |
-
const pathname = window.location.pathname
|
| 4 |
-
if (pathname.startsWith('/spaces/')) {
|
| 5 |
-
const parts = pathname.split('/').filter(Boolean)
|
| 6 |
-
if (parts.length >= 3) {
|
| 7 |
-
return `/${parts.slice(0, 3).join('/')}`
|
| 8 |
-
}
|
| 9 |
-
}
|
| 10 |
-
return ''
|
| 11 |
-
})()
|
| 12 |
|
| 13 |
async function request(path, options = {}) {
|
| 14 |
const url = path.startsWith('/') ? `${BASE}${path}` : `${BASE}/${path}`
|
|
|
|
| 1 |
+
const BASE = ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
async function request(path, options = {}) {
|
| 4 |
const url = path.startsWith('/') ? `${BASE}${path}` : `${BASE}/${path}`
|