https://github.com/jpmcb/sample-wasm-app
A simple WASM app served by through Go
https://github.com/jpmcb/sample-wasm-app
Last synced: 11 months ago
JSON representation
A simple WASM app served by through Go
- Host: GitHub
- URL: https://github.com/jpmcb/sample-wasm-app
- Owner: jpmcb
- Created: 2019-04-19T21:39:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-02T17:45:08.000Z (almost 7 years ago)
- Last Synced: 2025-06-05T18:08:01.163Z (about 1 year ago)
- Language: JavaScript
- Size: 339 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample-WASM-App
This simple WASM app uses a C `.wasm` binary and some javascript injection to perform a basic math operation.
## How to run:
From the project's root directory
```bash
GOOS=js GOARCH=wasm go build -o public/main.wasm
```
Ensure that Go's `wasm_exec.js` file is also being served from the public folder.
This is a harness for the page's javascript to access the Go WASM binary.
This this javascript file may be copied from the GOROOT:
```bash
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./public
```
#### Reference:
The following hackaday article inspired this project
- https://hackaday.com/2019/04/04/webassembly-what-is-it-and-why-should-you-care/