Unlisted
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// prototype rendering svg as png using resvg_wasm
import { render } from "https://deno.land/x/resvg_wasm/mod.ts";
const URL = "https://jxnblk-pie.web.val.run/?values=4,5,6";
export default async function(req: Request): Promise<Response> {
const res = await fetch(URL);
const svg = await res.text();
const png = await render(svg);
return new Response(png, {
headers: {
"Content-Type": "image/png",
},
});
}
jxnblk-blushporcupine.web.val.run
May 17, 2024