Spaces:
Paused
Paused
Update server/src/services/hf.ts
Browse files
server/src/services/hf.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
import fetch from 'node-fetch'
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
const
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
return j
|
| 9 |
}
|
|
|
|
| 1 |
import fetch from 'node-fetch'
|
| 2 |
+
|
| 3 |
+
export async function proxyHF(url: string, payload: any) {
|
| 4 |
+
const r = await fetch(url, {
|
| 5 |
+
method: 'POST',
|
| 6 |
+
headers: { 'Content-Type': 'application/json' },
|
| 7 |
+
body: JSON.stringify(payload)
|
| 8 |
+
})
|
| 9 |
+
const j: any = await r.json()
|
| 10 |
return j
|
| 11 |
}
|