diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-08 11:53:04 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-08 11:53:04 +0100 |
| commit | 0bace1ce8826a9a1be4003681fab5138f174c275 (patch) | |
| tree | bd191ef204486c950e8407718cb2ddb1dad64e44 /web/play/README.md | |
| parent | web: link the GPL source from the play page; normalise gateway config (diff) | |
| download | zagan-bet-0bace1ce8826a9a1be4003681fab5138f174c275.tar.gz zagan-bet-0bace1ce8826a9a1be4003681fab5138f174c275.zip | |
dev: add a no-nginx browser stack script
scripts/dev-web.sh builds the server, gateway and app, creates target/dev-web/identity, and runs the game server, webd and a loopback static server. The app accepts a ?ws= override only on loopback so the page and gateway can sit on different local ports; production stays same-origin at /ws.
Diffstat (limited to '')
| -rw-r--r-- | web/play/README.md | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/web/play/README.md b/web/play/README.md index 610c7a8..e18bb66 100644 --- a/web/play/README.md +++ b/web/play/README.md | |||
| @@ -17,17 +17,20 @@ Commit the generated `app.js` so the site deploys without Node. | |||
| 17 | 17 | ||
| 18 | ## Local development | 18 | ## Local development |
| 19 | 19 | ||
| 20 | Serve the repository's `web/` directory (for `/play/`) and put the gateway | 20 | From the repository root: |
| 21 | behind the same origin at `/ws`. The simplest local setup is nginx with the | ||
| 22 | `web/nginx.conf.example` block pointed at a staging root and | ||
| 23 | `ZAGAN_WEB_ORIGIN=http://127.0.0.1:8899`. For the app alone: | ||
| 24 | 21 | ||
| 25 | ```sh | 22 | ```sh |
| 26 | python3 -m http.server 8900 -d web/play | 23 | ./scripts/dev-web.sh |
| 27 | ``` | 24 | ``` |
| 28 | 25 | ||
| 29 | It will load, but the WebSocket will only connect through nginx or another | 26 | It builds the server, gateway and app, creates a throwaway identity under |
| 30 | proxy that routes `/ws` to `webd`. | 27 | `target/dev-web/`, starts the game server on `127.0.0.1:11525`, the gateway on |
| 28 | `127.0.0.1:8890` and a static server on `127.0.0.1:8899`, and prints the URL | ||
| 29 | (with a local-only `?ws=` override because the ports differ). Ctrl+C stops all | ||
| 30 | three. `--reset` starts with a fresh dev database. | ||
| 31 | |||
| 32 | The app only honours `?ws=` when the page is on `127.0.0.1`, `localhost` or | ||
| 33 | `::1`; a real deployment uses the same-origin `/ws` path. | ||
| 31 | 34 | ||
| 32 | ## Screens | 35 | ## Screens |
| 33 | 36 | ||
