统一推送数据库表
This commit is contained in:
23
server/README.md
Normal file
23
server/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 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`,用于本地持久化。
|
||||
Reference in New Issue
Block a user