nomadro/apps/api/README.md
eric 56b29205e7 Integrate four verticals into nomadro portal with shared packages and API gateway.
Mount /vip with nomadvip+payjsapi, add @nomadro/pay|pb|sdk, apps/api, /admin shell, and backup/rollback scripts under git.nomadro.cn workflow.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 20:16:44 -05:00

32 lines
988 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Nomadro API Gateway
统一 FastAPI 出口(OpenAPI / SDK)。垂直后端仍在各 `apps/*/backend` 与 `apps/payjsapi`。
## 本地
```bash
cd apps/api
python -m venv .venv
# Windows: .\.venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000
```
- Docs: http://127.0.0.1:8000/docs
- Health: http://127.0.0.1:8000/v1/health
- Modules: http://127.0.0.1:8000/v1/modules
- Pay resolve: `POST /v1/pay/resolve`
## 环境变量
| 变量 | 默认 | 说明 |
|------|------|------|
| `PORT` | `8000` | 监听端口 |
| `PAYJSAPI_URL` | `http://127.0.0.1:8007` | 支付网关 |
| `COMMUNITY_API_URL` | `http://127.0.0.1:8055` | 社群 FastAPI |
| `EBOOK_API_URL` | `http://127.0.0.1:8010` | 电子书 FastAPI |
| `POCKETBASE_URL` | `http://127.0.0.1:8090` | PocketBase |
| `CORS_ORIGINS` | `*` | 逗号分隔 |
门户 Next 默认 `API_URL=http://127.0.0.1:8000`,rewrite `/api/v1/*` → 本服务(或社群后端,见 `next.config.ts`)。