generated from bisco/codex-bootstrap
merge: fix frontend API proxy
This commit is contained in:
@@ -24,6 +24,8 @@ docker compose run --rm backend python manage.py createsuperuser
|
||||
|
||||
PostgreSQL is not published to the host.
|
||||
|
||||
During local development, the Angular dev server proxies `/api`, `/api-auth`, and `/admin` to the backend container.
|
||||
|
||||
## Volumes
|
||||
|
||||
- `postgres_data`: PostgreSQL data.
|
||||
|
||||
@@ -24,6 +24,7 @@ docker compose run --rm backend python manage.py createsuperuser
|
||||
|
||||
- If the frontend shows an authentication error, sign in through `http://localhost:8000/admin/` or DRF login first.
|
||||
- If the frontend serves a blank page, check `docker compose logs frontend`. Cache permission errors should be resolved by the configured `/tmp/angular-cache` path; restart with `docker compose up -d frontend`.
|
||||
- If the frontend loads but player data does not, confirm that `frontend/proxy.conf.json` is active and restart the frontend container.
|
||||
- If backend startup fails, check database readiness with `docker compose logs db`.
|
||||
- If dependencies change, rebuild with `docker compose build --no-cache backend frontend`.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "ng serve --host 0.0.0.0 --port 4200",
|
||||
"start": "ng serve --host 0.0.0.0 --port 4200 --proxy-config proxy.conf.json",
|
||||
"build": "ng build",
|
||||
"test": "tsx --import ./src/test-setup.ts --test \"src/**/*.spec.ts\"",
|
||||
"typecheck": "tsc --noEmit -p tsconfig.json"
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"/api": {
|
||||
"target": "http://backend:8000",
|
||||
"secure": false,
|
||||
"changeOrigin": false
|
||||
},
|
||||
"/api-auth": {
|
||||
"target": "http://backend:8000",
|
||||
"secure": false,
|
||||
"changeOrigin": false
|
||||
},
|
||||
"/admin": {
|
||||
"target": "http://backend:8000",
|
||||
"secure": false,
|
||||
"changeOrigin": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user