fix:优化启动配置

This commit is contained in:
Daniel
2026-03-07 23:47:29 +08:00
parent c3d219efc1
commit 7db497bc94
6 changed files with 219 additions and 4 deletions

16
start-api.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# 仅启动后端 API前后端分离时使用
# 在项目根目录执行: ./start-api.sh 或 PORT=3001 ./start-api.sh
# 若修改了默认端口,前端 api.config.json 的 apiBase 需填完整地址(含端口),如 http://域名或IP:5599
set -e
cd "$(dirname "$0")/server"
PORT="${PORT:-5599}"
export PORT
echo "[720yun-offline-api] 安装依赖..."
npm install --no-audit --no-fund
echo "[720yun-offline-api] 启动 API http://0.0.0.0:${PORT}"
echo "[720yun-offline-api] 前端请将 api.config.json 的 apiBase 设为: http://本机IP或域名:${PORT}"
exec node index.js