Commits
Tarun Sukhani authored eacf5b46a7f
docs(cli): document how a --frontend app finds the backend port in `play help` (PF-168)
PF-166 gave the scaffolded Nuxt frontend a resolution order for the backend port
(PLAY_BACKEND_PORT, then conf/application.conf, then 9000), but nothing surfaced
it — so the most natural workflow failed silently:
play run --http.port=9001 # backend on 9001
cd frontend && pnpm dev # proxies to 9000, nothing says why
A CLI port override never writes to conf/application.conf, so the frontend
consults the file, finds nothing configured and falls back to 9000 while the
backend is perfectly reachable on 9001. The page renders; only the API calls
fail, and no error names the mismatch.
print_usage() now carries a "Nuxt frontend" section listing both options and,
more importantly, *why* the CLI-override case needs the env var — that causal
link is the part a user cannot infer. `CMD="${1:-help}"` routes both a bare
`play` and `play help` through print_usage(), so one edit covers both.
Deliberately documented rather than automated. Deriving the port from a file the
server writes at bind time was considered — Server.java:71 already resolves the
real value into Server.httpPort — but a stale file from a killed server would
aim the frontend at a dead port, which is worse than the current predictable
9000. Two explicit options beat a mechanism with a silent failure mode.
Verified: `play` and `play help` render the section and remain byte-identical to
each other; `sh -n play` passes; `play version` and the PF-167 `play new` guard
still behave.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>