This is an example of how to build an Odin program using the js_wasm32 target. The example features a website that can call an Odin procedure.
Run build.bat (Windows) or build.sh (mac / Linux).
This builds the WASM module and also copies odin.js from the core Odin library as it's required for a js_wasm32 build.
You need to run a local webserver in the web directory in order to serve the site. There are few, simple options for this.
- Navigate to the
webdirectory.
cd web- Run a webserver.
# If you have Python installed.
python -m http.server# If you have Node.js installed.
npx http-server -p 8000 .- Visit http://localhost:8000