Wire API services to PostGIS in docker-compose, broaden CORS handling for cross-origin clients, and align developer docs with the production momswap URL. Made-with: Cursor
This commit is contained in:
@@ -20,7 +20,9 @@ go test ./...
|
||||
go run ./cmd/api
|
||||
```
|
||||
|
||||
Server default: `http://localhost:8080`.
|
||||
Primary deployed base URL: `https://momswap.produktor.duckdns.org/`.
|
||||
|
||||
Local default (for development): `http://localhost:8080`.
|
||||
|
||||
Optional environment variables:
|
||||
|
||||
@@ -35,6 +37,11 @@ Build and run the backend service:
|
||||
COMPOSE_BAKE=true docker compose up --build -d
|
||||
```
|
||||
|
||||
This starts:
|
||||
|
||||
- `db` (`postgis/postgis`) on `5432`
|
||||
- `api` on `8080`, wired with `DATABASE_URL` to the `db` service
|
||||
|
||||
Stop the service:
|
||||
|
||||
```bash
|
||||
@@ -52,6 +59,7 @@ Notes:
|
||||
- `api` service uses the production `runtime` image target.
|
||||
- `api-dev` profile uses the `dev` image target and Docker Compose watch.
|
||||
- Build cache is persisted at `.docker/buildx-cache` via `cache_from`/`cache_to`.
|
||||
- DB defaults can be overridden via `POSTGRES_DB`, `POSTGRES_USER`, `POSTGRES_PASSWORD`.
|
||||
|
||||
## Frontend
|
||||
|
||||
@@ -63,7 +71,10 @@ Example:
|
||||
go run ./cmd/api
|
||||
```
|
||||
|
||||
Then visit `http://localhost:8080/web/`.
|
||||
Then visit:
|
||||
|
||||
- Production: `https://momswap.produktor.duckdns.org/web/`
|
||||
- Local: `http://localhost:8080/web/`
|
||||
|
||||
## API client library
|
||||
|
||||
|
||||
Reference in New Issue
Block a user