import { fetch } from "https://esm.town/v/std/fetch";
export let blocks_inner = async (request: Request) => {
const [_, user, id, ...file] = new URL(request.url).pathname.split("/");
const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) => r.json());
const index = gist.files["index.html"];
if (!index) {
}
return new Response(
`
${index.content}
`,
{
headers: {
"Content-Type": "text/html",
"Cache-Control": "public,max-age=64800",
},
},
);
};