|
|
@@ -11,7 +11,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
const __dirname = dirname(__filename);
|
|
|
|
|
|
const app = express();
|
|
|
-const PORT = 3001;
|
|
|
+const PORT = process.env.PORT || 8888;
|
|
|
|
|
|
// 中间件
|
|
|
app.use(cors({
|
|
|
@@ -403,8 +403,8 @@ app.get('/api/health', (req, res) => {
|
|
|
res.json({ status: 'ok' });
|
|
|
});
|
|
|
|
|
|
-app.listen(PORT, () => {
|
|
|
- console.log(`后端服务器运行在 http://localhost:${PORT}`);
|
|
|
+app.listen(PORT, '0.0.0.0', () => {
|
|
|
+ console.log(`后端服务器运行在 http://0.0.0.0:${PORT}`);
|
|
|
console.log(`已配置的自动登录网站: ${Object.keys(autoLoginConfig).join(', ') || '无'}`);
|
|
|
- console.log(`自动登录端点格式: http://localhost:${PORT}/api/auto-login/:siteId`);
|
|
|
+ console.log(`自动登录端点格式: http://0.0.0.0:${PORT}/api/auto-login/:siteId`);
|
|
|
});
|