Spaces:
Sleeping
Sleeping
| import Koa from "koa"; | |
| const app = new Koa(); | |
| app.use(async (ctx) => { | |
| console.log(ctx.request.url, ctx.request.method); | |
| ctx.body = { | |
| fullUrl: ctx.request.url, | |
| type: typeof ctx.request.url, | |
| query: ctx.request.query, | |
| s3url: await fetch('https://huggingface.co/gpt2/resolve/main/64.tflite', {redirect: "manual"}).then(r => r.headers.get("Location")), | |
| headers: Object.fromEntries(Object.entries(ctx.request.headers)), | |
| env: process.env | |
| }; | |
| }); | |
| app.listen(7860); | |