From 0bace1ce8826a9a1be4003681fab5138f174c275 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 8 Nov 2026 11:53:04 +0100 Subject: 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. --- web/play/README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'web/play/README.md') 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. ## Local development -Serve the repository's `web/` directory (for `/play/`) and put the gateway -behind the same origin at `/ws`. The simplest local setup is nginx with the -`web/nginx.conf.example` block pointed at a staging root and -`ZAGAN_WEB_ORIGIN=http://127.0.0.1:8899`. For the app alone: +From the repository root: ```sh -python3 -m http.server 8900 -d web/play +./scripts/dev-web.sh ``` -It will load, but the WebSocket will only connect through nginx or another -proxy that routes `/ws` to `webd`. +It builds the server, gateway and app, creates a throwaway identity under +`target/dev-web/`, starts the game server on `127.0.0.1:11525`, the gateway on +`127.0.0.1:8890` and a static server on `127.0.0.1:8899`, and prints the URL +(with a local-only `?ws=` override because the ports differ). Ctrl+C stops all +three. `--reset` starts with a fresh dev database. + +The app only honours `?ws=` when the page is on `127.0.0.1`, `localhost` or +`::1`; a real deployment uses the same-origin `/ws` path. ## Screens -- cgit v1.2.3