docs: backend by default, mock on request, how sockets authenticate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
673e903e65
commit
ec421f2537
|
|
@ -12,7 +12,9 @@ This is the Nuxt client for a browser strategy game in the style of Tribal Wars.
|
||||||
|
|
||||||
## Mock server
|
## Mock server
|
||||||
|
|
||||||
Until the backend serves the WS API, runtime config `MOCK_SERVER` (on by default) swaps the `ws` singleton and login for `app/mock/`: an in-browser fake that answers the same intents with the payloads in `app/types/game.ts`, finishes build orders on timers, and pushes `village:updated`. Its numbers and rules are placeholders, not game design. Run against a real backend with `NUXT_PUBLIC_MOCK_SERVER=false`, and delete `app/mock/` once nothing needs it.
|
The client talks to the real backend by default (`server-village.localhost.at` locally; the server's `.env` points the static build at `server-village.blax.at`). For UI work without a backend, `NUXT_PUBLIC_MOCK_SERVER=true` swaps the `ws` singleton and login for `app/mock/`: an in-browser fake that answers the same intents with the payloads in `app/types/game.ts`, finishes build orders on timers, and pushes `village:updated`. Its numbers and rules are placeholders, not game design; the backend is the source of truth. Delete `app/mock/` once nothing needs it.
|
||||||
|
|
||||||
|
Every `ws.send` carries the bearer token as `authtoken` (added in `app/utils/networking.ts`): that is how the WS server authenticates a socket.
|
||||||
|
|
||||||
## Task tracking: Taiga board `village-politics`
|
## Task tracking: Taiga board `village-politics`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue