|
|
@@ -11,7 +11,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
const __dirname = dirname(__filename);
|
|
|
|
|
|
const app = express();
|
|
|
-const PORT = process.env.PORT || 8888;
|
|
|
+const PORT = process.env.PORT || 8889;
|
|
|
|
|
|
// 中间件
|
|
|
app.use(cors({
|
|
|
@@ -671,13 +671,14 @@ app.listen(PORT, '0.0.0.0', () => {
|
|
|
console.log('\n' + '='.repeat(80));
|
|
|
console.log('🚀 后端服务器启动成功!');
|
|
|
console.log('='.repeat(80));
|
|
|
+ console.log(`📍 本地地址: http://localhost:${PORT}`);
|
|
|
console.log(`📍 服务器地址: http://0.0.0.0:${PORT}`);
|
|
|
- console.log(`📍 外部访问: http://222.243.138.146:${PORT}`);
|
|
|
+ console.log(`📍 外部访问: http://222.243.138.146:${PORT} (通过防火墙端口映射)`);
|
|
|
console.log(`\n📋 已配置的自动登录网站: ${Object.keys(autoLoginConfig).join(', ') || '无'}`);
|
|
|
console.log(`\n🔗 可用端点:`);
|
|
|
- console.log(` - 健康检查: http://222.243.138.146:${PORT}/api/health`);
|
|
|
- console.log(` - 测试配置: http://222.243.138.146:${PORT}/api/test/:siteId`);
|
|
|
- console.log(` - 自动登录: http://222.243.138.146:${PORT}/api/auto-login/:siteId`);
|
|
|
- console.log(`\n💡 提示: 查看 TROUBLESHOOTING.md 了解问题排查方法`);
|
|
|
+ console.log(` - 健康检查: http://localhost:${PORT}/api/health`);
|
|
|
+ console.log(` - 测试配置: http://localhost:${PORT}/api/test/:siteId`);
|
|
|
+ console.log(` - 自动登录: http://localhost:${PORT}/api/auto-login/:siteId`);
|
|
|
+ console.log(`\n💡 提示: 确保防火墙已配置端口映射 (前端:8888, 后端:8889 -> 外网)`);
|
|
|
console.log('='.repeat(80) + '\n');
|
|
|
});
|