Fix README clarity issues from code review
- Add explicit mkdir -p public before wasm_exec.js copy - Specify to save app code as main.go - Specify to save server code as server.go Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit was merged in pull request #12.
This commit is contained in:
14
README.md
14
README.md
@@ -9,10 +9,18 @@ Get from zero to a running app in under 5 minutes.
|
||||
### Prerequisites
|
||||
|
||||
- Go 1.23 or later
|
||||
- Copy the WASM support file: `cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./public/`
|
||||
|
||||
### Project setup
|
||||
|
||||
```bash
|
||||
mkdir -p public
|
||||
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./public/
|
||||
```
|
||||
|
||||
### Create your app
|
||||
|
||||
Save this as `main.go`:
|
||||
|
||||
```go
|
||||
//go:build js && wasm
|
||||
|
||||
@@ -73,7 +81,7 @@ GOOS=js GOARCH=wasm go build -o public/app.wasm ./main.go
|
||||
|
||||
### Run
|
||||
|
||||
Create a simple server or use the built-in host:
|
||||
Save this as `server.go`:
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -90,7 +98,7 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
Run it:
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
go run server.go
|
||||
|
||||
Reference in New Issue
Block a user