Files
mv2_simple_crx/server/README.md
张成 37e39d35b8 1
2026-03-18 15:25:34 +08:00

41 lines
776 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.
## serverKoa + Sequelize + MySQL
### 功能
- `POST /api/crawl/run_action`:服务端调用扩展 action返回结果并按 `stage` 自动入库
- **定时任务写死配置**`config/cron_tasks.js`(不走数据库)
### 运行
1. 安装依赖
```bash
cd server
npm install
```
2. 配置环境变量
```bash
copy .env.example .env
```
3. 初始化/更新表结构
```bash
node scripts/db_sync.js
```
4. 启动
```bash
node app.js
```
### 定时任务
编辑 `config/cron_tasks.js``cron_task_list`,重启服务即可生效。
### 落库表
- `crawl_run_record`:所有 action 调用的原始请求/响应
- `amazon_product``stage=detail` 详情
- `amazon_search_item``stage=list` 列表 item
- `amazon_review``stage=reviews` 评论