Public
Back
Version 12
7/13/2023
let blocks = async (req, res) => {
const [_, user, id] = req.path.split("/");
const gist = await fetch(`https://api.github.com/gists/${id}`).then((r) =>
r.json()
);
const index = gist.files["index.html"];
if (!index) {
return res.end({ message: "Gist did not contain index.html" });
}
return res.send(index.content);
};
Updated: October 23, 2023