GUI-STUDIO commited on
Commit ·
06ba820
1
Parent(s): 5d44c89
Create test.ts
Browse files- src/sub-router/test.ts +29 -0
src/sub-router/test.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Context, Elysia, t } from "elysia";
|
| 2 |
+
|
| 3 |
+
const sub_router = new Elysia({ prefix: "/test" }).get("/foo", async (ctx) => {
|
| 4 |
+
const { query, params, request, status } = ctx;
|
| 5 |
+
|
| 6 |
+
const REQ0 = request.url;
|
| 7 |
+
const REQ_ORIGIN = (ctx as any).publicOrigin || new URL(REQ0).origin;
|
| 8 |
+
|
| 9 |
+
const res = await fetch(
|
| 10 |
+
"https://dl.gemlelispe.workers.dev/https%3A%2F%2Fbcdnxw.hakunaymatata.com%2Fbt%2F7e1c2ff4f2a619c16f40825883eebe6e.mp4%3Fsign%3D288c2a2346ad3cd3c22dcc70e483ca7f%26t%3D1773678165?n=Vini%20Jr.%20(2025)",
|
| 11 |
+
{
|
| 12 |
+
headers: {
|
| 13 |
+
referer: "https://dl.vidsrc.vip/"
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
);
|
| 17 |
+
|
| 18 |
+
const res_status = res.status;
|
| 19 |
+
const res_headers = res.headers;
|
| 20 |
+
|
| 21 |
+
const res_headers_object = Object.fromEntries((res_headers as any).entries());
|
| 22 |
+
|
| 23 |
+
return {
|
| 24 |
+
res_status,
|
| 25 |
+
res_headers: res_headers_object
|
| 26 |
+
};
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
export const TestRouter = sub_router;
|