96fd97efa9
apps/web/.env.production hardcoded VITE_API_BASE=http://127.0.0.1:3000 — a
desktop-only value that's WRONG for the booth, which serves the SPA same-origin
(Fastify dist/ via Caddy :80) and needs a RELATIVE /api base. An absolute origin
baked at build would point the browser at localhost. origin.ts treats empty as
relative (API_BASE=""), matching the deploy (the 77b2acb fix / container-deployment
"Web access").
The desktop (Tauri) build DOES need an absolute origin, but that app is a deferred
separate task (currently hardcoded localhost); it must set VITE_API_BASE for its own
build when resumed, not here. Comment updated to say so.
15 lines
926 B
Bash
15 lines
926 B
Bash
# Production build env for the SPA (auto-loaded by `vite build`). NOT loaded by `vite` dev.
|
|
#
|
|
# RELATIVE /api base (empty value). The booth serves the SPA same-origin (Fastify serves
|
|
# dist/, reached via Caddy on :80), so requests must stay relative — baking an absolute
|
|
# origin here would point the browser at the wrong host. This matches the deploy
|
|
# (wiki/decisions/container-deployment.md "Web access"; the 77b2acb fix).
|
|
#
|
|
# DESKTOP (Tauri) NOTE: the desktop shell serves the SPA from tauri://localhost (no proxy,
|
|
# not same-origin) and DOES need an absolute Fastify origin — but the desktop app is a
|
|
# DEFERRED, separate task (it's currently hardcoded to localhost:3000; see apps/desktop +
|
|
# the desktop-app-hardcoded-localhost note). When that work resumes, set VITE_API_BASE to
|
|
# the appliance's Fastify origin for the desktop build only (e.g. via apps/desktop or an
|
|
# exported override), NOT here.
|
|
VITE_API_BASE=
|