Standardize API port 23568 and web port 23566 across docs and dev config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 13:07:46 +08:00
parent 2a5fb5f469
commit a3d4875bde
4 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -46,13 +46,13 @@ cd backend
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
uvicorn app.main:app --reload --port 23568
cd frontend
npm install && npm run dev
```
开发前端:http://localhost:5173(代理 `/api`8000
开发前端:http://localhost:5173(代理 `/api`23568
生产网关本地模拟:
+1 -1
View File
@@ -2,7 +2,7 @@ DATABASE_URL=postgresql://gradeapp:postgres@127.0.0.1:5432/student_archive
SECRET_KEY=dev-secret-key-change-in-production
CORS_ORIGINS=http://localhost:5173,http://localhost:23566
UPLOAD_DIR=uploads
API_PORT=8000
API_PORT=23568
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen2.5:7b
FLUCTUATION_THRESHOLD=0.08
+4 -3
View File
@@ -13,14 +13,14 @@
| 系统 | Ubuntu 20.04 / 22.04 / 24.04 |
| 用户 | **root** |
| 目录 | `/opt/secondary-school-grade-archive` |
| 端口 | **23566**Web + API 统一入口 |
| 端口 | **23566** 对外 Web**23568** 内部 API(仅本机 |
| 反向代理 | **不包含**,请自行配置 |
### 架构
```
浏览器 → :23566 (PM2: grade-web, Express 静态 + /api 反代)
└──→ 127.0.0.1:8000 (PM2: grade-api, Uvicorn)
└──→ 127.0.0.1:23568 (PM2: grade-api, Uvicorn)
└──→ PostgreSQL (本机)
└──→ uploads/
└──→ Ollama (本机可选, :11434)
@@ -72,7 +72,8 @@ bash deploy/install.sh
| 变量 | 默认 | 说明 |
|------|------|------|
| `WEB_PORT` | 23566 | 对外 Web 端口 |
| `API_PORT` | 8000 | 内部 API 端口 |
| `API_PORT` | 23568 | 内部 API 端口(仅本机,勿与 8000 等常用端口冲突) |
| `API_TARGET` | `http://127.0.0.1:23568` | Web 网关转发目标 |
| `DATABASE_URL` | 自动生成 | PostgreSQL 连接 |
| `SECRET_KEY` | 自动生成 | JWT 密钥 |
| `UPLOAD_DIR` | `.../uploads` | 错题图片目录 |
+1 -1
View File
@@ -7,7 +7,7 @@ export default defineConfig({
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:8000',
target: 'http://localhost:23568',
changeOrigin: true,
},
},