Spaces:
Sleeping
Sleeping
T1ckbase
commited on
Commit
·
ab40919
1
Parent(s):
b0c01ee
main.ts
CHANGED
|
@@ -10,9 +10,8 @@ app.use(logger());
|
|
| 10 |
app.get('/', (c) => c.text('Hello Hono!'));
|
| 11 |
|
| 12 |
app.post('*', async (c) => {
|
| 13 |
-
const
|
| 14 |
-
const
|
| 15 |
-
const targetUrl = `${HF_API_URL}${targetPath}`;
|
| 16 |
|
| 17 |
const headers = new Headers(c.req.raw.headers);
|
| 18 |
headers.delete('Authorization');
|
|
|
|
| 10 |
app.get('/', (c) => c.text('Hello Hono!'));
|
| 11 |
|
| 12 |
app.post('*', async (c) => {
|
| 13 |
+
const { pathname, search } = new URL(c.req.url);
|
| 14 |
+
const targetUrl = `${HF_API_URL}${pathname}${search}`;
|
|
|
|
| 15 |
|
| 16 |
const headers = new Headers(c.req.raw.headers);
|
| 17 |
headers.delete('Authorization');
|