Documentation
¶
Overview ¶
devserver — small static file server with the COOP / COEP / CORP headers that Chrome and Firefox require before they expose `SharedArrayBuffer` and `Atomics.wait` to the page. The js/wasm runtime needs both for synchronous send/recv across SharedWorker boundaries.
Usage (called from `make serve/js`):
go run ./cmd/web -dir build/web -addr :8080
On `:8080` it serves the directory tree rooted at `dir`, returning `index.html` for `/`. Every response carries:
Cross-Origin-Opener-Policy: same-origin Cross-Origin-Embedder-Policy: require-corp Cross-Origin-Resource-Policy: same-origin
which puts the page in a "cross-origin isolated" context.
Click to show internal directories.
Click to hide internal directories.