修复远程访问:监听所有网络接口 (0.0.0.0)

- 修改 app.listen() 绑定到 0.0.0.0 而不是默认的 localhost
- 自动检测并显示本机 IP 地址
- 更新启动脚本使用正确的数据库端口 (5433)
- 现在可以通过局域网访问 http://192.168.0.250:3000
This commit is contained in:
work-1
2026-02-15 15:13:20 +08:00
parent 71f03f4125
commit d75230522e
3 changed files with 117 additions and 3 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ echo "启动应用服务..."
pkill -f "node.*server-postgres.js" || true
cd "$(dirname "$0")"
DB_HOST=localhost \
DB_PORT=5432 \
DB_PORT=5433 \
DB_PASSWORD=postgres \
nohup node server-postgres.js > server.log 2>&1 &