summaryrefslogtreecommitdiffstats
path: root/web/play/README.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-08 11:53:04 +0100
committersalmonik <salmonik@tuta.io>2026-11-08 11:53:04 +0100
commit0bace1ce8826a9a1be4003681fab5138f174c275 (patch)
treebd191ef204486c950e8407718cb2ddb1dad64e44 /web/play/README.md
parentweb: link the GPL source from the play page; normalise gateway config (diff)
downloadzagan-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.md17
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
20Serve the repository's `web/` directory (for `/play/`) and put the gateway 20From the repository root:
21behind 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
26python3 -m http.server 8900 -d web/play 23./scripts/dev-web.sh
27``` 24```
28 25
29It will load, but the WebSocket will only connect through nginx or another 26It builds the server, gateway and app, creates a throwaway identity under
30proxy 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
30three. `--reset` starts with a fresh dev database.
31
32The 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