Commit 982b1eb9 authored by nagayama15's avatar nagayama15

Change wasm directory

parent 4e9105a6
......@@ -12,19 +12,16 @@ const server = app.listen(port, () => {
console.log(`server listening at port ${port}`);
});
app.get(
"/wasm/add.wasm",
async (req: express.Request, res: express.Response) => {
const path = `${__dirname}/../wasm/add.wasm`;
const watermark = req.query.v || "";
app.get("/add.wasm", async (req: express.Request, res: express.Response) => {
const path = `${__dirname}/../wasm/add.wasm`;
const watermark = req.query.v || "";
res.writeHead(200, { "Content-Type": "application/wasm" });
res.writeHead(200, { "Content-Type": "application/wasm" });
console.time("kyut");
const process = childProcess.spawn(watermarker, [path, watermark, "-"]);
process.stdout.pipe(res);
res.on("finish", () => console.timeEnd("kyut"));
}
);
console.time("kyut");
const process = childProcess.spawn(watermarker, [path, watermark, "-"]);
process.stdout.pipe(res);
res.on("finish", () => console.timeEnd("kyut"));
});
app.use(express.static(`${__dirname}/../static`));
......@@ -18,7 +18,7 @@
(async () => {
// Import wasm module
const wasm = await WebAssembly.instantiateStreaming(
fetch("wasm/add.wasm")
fetch("add.wasm")
);
const { add2, add3 } = wasm.instance.exports;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment