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());
}