This shows how you can import Rust WASM files into Deno to speed things up greatly.
// Installation
-
Install rust. a. Go to https://www.rust-lang.org/tools/install. b. Copy install script. c. Run script on machine.
-
Install wasm-pack a. Go to https://rustwasm.github.io/wasm-pack/installer/ b. Copy install script c. Run on machine
// Build rwasm
- cd into rwasm directory.
- Run "wasm-pack buld".
// Run server
- deno run --allow-net --allow-read app.ts
// Test server
- Deno: curl -d '{"type":"deno","rounds":46340}' -H 'Content-Type: application/json' http://localhost:8000/api
- Rust: curl -d '{"type":"rust","rounds":46340}' -H 'Content-Type: application/json' http://localhost:8000/api