From e0e7efaba293a8d907690e6872e72bf2696ae536 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 23 Aug 2026 11:47:09 +0000 Subject: [PATCH] docs(console): fix VITE_SERVER_URL dev defaults and dev-proxy scope in READMEs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #5765 emptied VITE_SERVER_URL in both dev env files (same-origin by default, per the 2026-08-23 ruling on #5702). Three doc-prose items had drifted from that: 1. apps/console/README.md's Quick Start and Development Mode sections still said VITE_SERVER_URL defaults to http://localhost:3000 — it now ships empty, with the Vite dev proxy (DEV_PROXY_TARGET, defaulting to http://localhost:3000) forwarding /api/* to the backend. 2. examples/console-starter/README.md's Backend table still tabulated the old non-empty .env.development/.env.production values — both now ship empty (same-origin), documented with the same DEV_PROXY_TARGET recipe. 3. apps/console/README.md claimed the dev proxy covers /api/* and /_account/* — vite.config.ts only ever proxied /api. Per triage discretion on #5766 (zero first-party producers of /_auth/ or /_account/ action targets on origin/main, and /_account is recorded as retired into the console SPA), this fixes the doc rather than widening the proxy: states /api/* only and notes /_auth/* and /_account/* are not proxied. Fixes #5766 Filed #5802 (out of scope) for the same stale-default drift in content/docs/guide/console.md, which sits outside this card's scope. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m --- apps/console/README.md | 15 ++++++++++----- examples/console-starter/README.md | 9 +++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/console/README.md b/apps/console/README.md index ca6d75edf7..15fc23c727 100644 --- a/apps/console/README.md +++ b/apps/console/README.md @@ -32,8 +32,11 @@ pnpm test ``` The console is a **pure SPA** and requires an external ObjectStack backend. -Point it at any running ObjectStack instance via `VITE_SERVER_URL` in -`apps/console/.env.development` (defaults to `http://localhost:3000`). +`VITE_SERVER_URL` in `apps/console/.env.development` ships empty (same-origin); +the Vite dev server proxies `/api/*` to `http://localhost:3000` by default, or +to `DEV_PROXY_TARGET` when set — e.g. +`DEV_PROXY_TARGET=https://demo.objectstack.ai pnpm dev` — to point dev at a +different backend without leaving same-origin. To run a backend locally, use the `@objectstack/cli` from a separate ObjectStack project checkout — we no longer ship an in-repo dev-server @@ -49,9 +52,11 @@ The console runs as a standalone SPA against any ObjectStack backend: - Vite dev server with Hot Module Replacement (HMR), opens at http://localhost:5180. -- Talks to the ObjectStack backend defined by `VITE_SERVER_URL` - (default `http://localhost:3000`). -- Vite proxies `/api/*` and `/_account/*` to that backend. +- `VITE_SERVER_URL` is empty by default (same origin); Vite proxies `/api/*` + to `http://localhost:3000`, or to `DEV_PROXY_TARGET` when set, to reach the + ObjectStack backend. +- Only `/api/*` is proxied — `/_auth/*` and `/_account/*` are **not** + proxied. ### 2. Standalone SPA preview **Command:** `pnpm start` diff --git a/examples/console-starter/README.md b/examples/console-starter/README.md index 239698349f..9f7195a347 100644 --- a/examples/console-starter/README.md +++ b/examples/console-starter/README.md @@ -88,8 +88,13 @@ ObjectStack server serves the console itself. | File | Value | |---|---| -| [`.env.development`](./.env.development) | `http://localhost:3000` | -| [`.env.production`](./.env.production) | `https://demo.objectstack.ai` | +| [`.env.development`](./.env.development) | empty (same-origin) | +| [`.env.production`](./.env.production) | empty (same-origin) | + +Both files ship empty. In dev, the Vite server proxies `/api/*` to +`http://localhost:3000` by default; to point dev at a different backend while +keeping one origin, set `DEV_PROXY_TARGET`, e.g. +`DEV_PROXY_TARGET=https://demo.objectstack.ai pnpm dev`. Point it at any ObjectStack server. If you need one locally, this repo's live-e2e helper [`e2e/live/ci/start-backend.sh`](../../e2e/live/ci/start-backend.sh) boots a