Try it: https://conway-jordi.vercel.app/
This a Rust implementation of Cownway's Game Of Life using WebAssembly.
You need to have installed the Rust toolchain rustup
. On a Unix system:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
You need to have installed wasm-pack
. On a Unix system:
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Using cargo:
cargo install wasm-pack
Using npm:
npm install -g wasm-pack
Finally, you must have NodeJS installed.
Generate the WebAssembly binary running this command:
wasm-pack build
This will create a pkg
directory.
Initialize the NodeJS application:
npm init wasm-app web
This will generate a web
directory.
Move the pkg
directory into web
directory.
cp -rf pkg web && rm -r pkg && rm web/pkg/.gitignore
Also we removed the pkg
directory and the .gitignore
file (for deployment).
You can start the NodeJS server using the following commands:
cd web
npm cache clean -f
rm -rf node_modules package-lock.json
npm i
npm run start
For example, we can use Vercel to deploy our app.
You can deploy it with the following configuration: