feat(nest-front): add API_URL proxy and VITE_API_URL support for split deployment
- nginx.conf: proxy /api/ to ${API_URL} (injected at container start via envsubst)
- Dockerfile: accept VITE_API_URL build arg; use envsubst CMD to hydrate nginx template
- src/utils/api.ts: export API_BASE using VITE_API_URL or fallback to /api
Enables nest-front to run on Coolify while nest-backend runs on Portainer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
4
nest-front/src/utils/api.ts
Normal file
4
nest-front/src/utils/api.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// API base URL.
|
||||
// - In Docker (Coolify): nginx proxies /api/* to the backend, so we use a relative path.
|
||||
// - Set VITE_API_URL at build time to call the backend directly (e.g. during local dev without nginx).
|
||||
export const API_BASE = import.meta.env.VITE_API_URL ?? '/api'
|
||||
Reference in New Issue
Block a user