# 部署说明 ## 1. 后端 1. 复制 `backend/config.example.json` → `backend/config.json` 并填真实值。 2. 编辑 `backend/src/relay/relay-config.ts`,将 `sk-TARGET_RELAY_SK` 换成公司发放的实例 sk。 3. 安装依赖(按项目实际:npm/bun/deno + fmode-server)。 4. 生产用 **fmode-server** 启动(自动挂 `/parse` 与 `api/routes.ts` → `/api`)。 5. 检查: - `GET /health` - `GET /api/sorftime/health` - `GET /api/tikhub/health` ## 2. 前端 1. 编辑 `frontend/src/assets/runtime-config.json`: - `parse.appId` / `parse.serverUrl` - `apiBaseUrl`(生产可空字符串走同源反代) 2. `npm ci && npm run build`(或项目既有 build:prod) 3. 将 `dist/` 发布到静态目录。 ## 3. 反代 见 `nginx.example.conf`: ```text / → frontend dist /api/* → backend /parse/* → backend Parse /health → backend ``` 浏览器不得直连 `server.fmode.cn` 的上游 Token 接口;AI nova 如需公司 parse,仅用登录后 session,不写死 token。 ## 4. 健康检查清单 ```bash curl -s https://TARGET_HOST/health curl -s https://TARGET_HOST/api/sorftime/health curl -s https://TARGET_HOST/api/tikhub/health curl -s https://TARGET_HOST/api/ping ``` ## 5. 回滚 保留上一版: - frontend dist - backend 提交 / 目录 - config.json 备份 - 数据库备份(若已初始化)