Commit 982b1eb9 authored by nagayama15's avatar nagayama15

Change wasm directory

parent 4e9105a6
...@@ -12,9 +12,7 @@ const server = app.listen(port, () => { ...@@ -12,9 +12,7 @@ const server = app.listen(port, () => {
console.log(`server listening at port ${port}`); console.log(`server listening at port ${port}`);
}); });
app.get( app.get("/add.wasm", async (req: express.Request, res: express.Response) => {
"/wasm/add.wasm",
async (req: express.Request, res: express.Response) => {
const path = `${__dirname}/../wasm/add.wasm`; const path = `${__dirname}/../wasm/add.wasm`;
const watermark = req.query.v || ""; const watermark = req.query.v || "";
...@@ -24,7 +22,6 @@ app.get( ...@@ -24,7 +22,6 @@ app.get(
const process = childProcess.spawn(watermarker, [path, watermark, "-"]); const process = childProcess.spawn(watermarker, [path, watermark, "-"]);
process.stdout.pipe(res); process.stdout.pipe(res);
res.on("finish", () => console.timeEnd("kyut")); res.on("finish", () => console.timeEnd("kyut"));
} });
);
app.use(express.static(`${__dirname}/../static`)); app.use(express.static(`${__dirname}/../static`));
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
(async () => { (async () => {
// Import wasm module // Import wasm module
const wasm = await WebAssembly.instantiateStreaming( const wasm = await WebAssembly.instantiateStreaming(
fetch("wasm/add.wasm") fetch("add.wasm")
); );
const { add2, add3 } = wasm.instance.exports; 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