feat(server): 更新默认端口为 5000 并支持环境变量配置

- 将 Web 服务器默认端口从 3000 更改为 5000
- 支持通过环境变量 PORT 自定义端口
- 添加 dotenv 依赖以加载环境变量
- 更新 README.md 中的所有相关端口说明
- 配置文件 config.json 加入 .gitignore 以防止敏感信息泄露
- 前端 API 地址改为自动检测当前域名和端口,提升部署灵活性
```
This commit is contained in:
2025-12-15 15:58:48 +08:00
parent 00658a3445
commit f35d4575c8
8 changed files with 48 additions and 6 deletions

13
package-lock.json generated
View File

@@ -12,6 +12,7 @@
"cheerio": "^1.0.0-rc.12",
"cors": "^2.8.5",
"docx": "^9.5.1",
"dotenv": "^17.2.3",
"express": "^5.2.1",
"iconv-lite": "^0.6.3",
"node-cron": "^4.2.1",
@@ -599,6 +600,18 @@
"url": "https://github.com/fb55/domutils?sponsor=1"
}
},
"node_modules/dotenv": {
"version": "17.2.3",
"resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-17.2.3.tgz",
"integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",