Spaces:
Sleeping
Sleeping
File size: 491 Bytes
c24174e 0fb7b7d 5ddc821 c24174e ae53db5 4f1472a ae53db5 0fb7b7d 3726cd2 3ad5c6f c24174e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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);
|