blob: 14d3d0fbe82f276614e01aead8a91884b15e726b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { type APIContext } from 'astro';
// @ts-ignore
import mod from '../util/add.wasm';
const addModule: any = new WebAssembly.Instance(mod);
export async function GET(
context: APIContext
): Promise<Response> {
return new Response(JSON.stringify({ answer: addModule.exports.add(20, 1) }), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
}
|