1
2
3
4
5
6
7
8
9
10
11
12
13
14
import createPlugin from "https://esm.sh/@extism/extism";
export default async function(req: Request): Promise<Response> {
const plugin = await createPlugin(
"https://cdn.modsurfer.dylibso.com/api/v1/module/ec17c9afde08aa9e7fa857fe2c9cbb9206e3a3dbec98429ceebd3421de7070da.wasm",
{ useWasi: false },
);
const data = {
event_file_name: "input.md",
event_file_data: btoa(await req.text()),
};
let out = await plugin.call("on_file_write", JSON.stringify(data));
return Response.json(out.json());
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
stevekrouse-untitled_amberleopard.web.val.run
v0
December 14, 2023