Files
medical-mall/server/README.md
2026-02-24 11:28:13 +08:00

24 lines
834 B
Markdown
Raw 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.
# Push Server (开发用)
这是一个用于本地开发与调试的轻量 Node.js 推送后端mock
功能:
- 注册/更新设备:`POST /api/v1/push/register` { cid, user_id, platform }
- 注销设备:`POST /api/v1/push/unregister` { cid | user_id }
- 列出设备:`GET /api/v1/push/devices?user_id=...&active=true|false`
- 发送推送(模拟):`POST /api/v1/push/send` { cids:[], user_id, notification, payload }
如果你有真实的推送服务端 API可以设置环境变量 `PUSH_PROXY_URL`(和可选的 `PUSH_PROXY_TOKEN`),服务器会将 `/api/v1/push/send` 请求代理到该 URL。
快速使用:
```bash
cd server
npm install
npm start
```
默认监听端口:`7301`,可通过 `PORT` 环境变量修改。
设备存储在 `server/data/push_devices.json`,用于本地持久化。