Public
Back
Version 3
7/29/2023
async function valTownSpec(req: express.Request, res: express.Response) {
const yaml = await import("npm:yaml");
const resp = await fetch("https://www.val.town/docs/openapi.yaml");
const text = await resp.text();
res.send("text");
const spec = yaml.parse(res);
const code = `export default ${JSON.stringify(spec, null, 2)} as const;`;
res.set("Content-Type", "text/typescript");
res.send(code);
}
pomdtr-valtownopenapi.web.val.run
Updated: October 23, 2023