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