Standardize SurClaw ports away from defaults

- Change the API default listen port from 3000 to 3100 and include the Docker frontend origin in default CORS.

- Point Vite's default API proxy, Docker API container port, and Nginx upstream to 3100.

- Keep Docker host ports on 4002 for web, 3002 for API, and 5433 for PostgreSQL.

- Update environment examples and documentation to remove stale localhost:3000 guidance.
This commit is contained in:
2026-05-02 02:17:07 +08:00
parent 750cf4129d
commit 7c6449b7bd
11 changed files with 25 additions and 24 deletions

View File

@@ -24,7 +24,7 @@
```bash
npm install
npm run dev # Vite dev server, 0.0.0.0:3001
npm run server:dev # build and start NestJS API, 0.0.0.0:3000
npm run server:dev # build and start NestJS API, 0.0.0.0:3100
npm run server:build # tsc -p server/tsconfig.json
npm run lint # tsc --noEmit
npm run test # vitest run
@@ -287,7 +287,7 @@ npm run test:e2e
统一前端 API 请求封装:
- 默认请求相对路径 `/api/...`
- Vite 开发模式通过 `VITE_API_PROXY_TARGET` 代理 API默认 `http://localhost:3000`
- Vite 开发模式通过 `VITE_API_PROXY_TARGET` 代理 API默认 `http://localhost:3100`
- 请求带 `credentials: 'include'`,用于后端 HttpOnly Session Cookie。
- 解包后端 `{ data }` 响应,错误时抛出 `ApiError`