Files
yunhaifinance/backend/port3000-server.js
T

44 lines
1.7 KiB
JavaScript
Raw Normal View History

const express = require('express');
const app = express();
const PORT = 3000;
app.get('/', (req, res) => {
res.send(`
<!DOCTYPE html>
<html>
<head><title>测试 - 端口3000</title><meta charset="utf-8"></head>
<body style="font-family: Arial; padding: 40px;">
<h1>✅ 公司财务管理系统 - 测试入口</h1>
<p>服务器: 43.161.248.209:${PORT}</p>
<p>状态: <span style="color: green; font-weight: bold;">运行正常</span></p>
<div style="background: #f0f8ff; padding: 20px; border-radius: 10px; margin: 20px 0;">
<h2>🚀 立即访问系统:</h2>
<p><a href="http://43.161.248.209:5000/app/index.html" style="font-size: 18px; color: #1890ff;">👉 点击这里打开主应用</a></p>
<p>如果上方链接无法访问,请尝试:</p>
<ul>
<li><a href="http://43.161.248.209:5000/test">测试页面</a></li>
<li><a href="http://43.161.248.209:5000/api/health">API健康检查</a></li>
</ul>
</div>
<div style="background: #fff0f0; padding: 15px; border-radius: 5px;">
<h3>🔧 如果端口5000无法访问:</h3>
<p>1. 检查腾讯云安全组规则,确保端口5000已开放</p>
<p>2. 或使用此页面作为入口,系统功能正常</p>
</div>
</body>
</html>
`);
});
// 重定向到5000端口
app.get('/redirect', (req, res) => {
res.redirect('http://43.161.248.209:5000/app/index.html');
});
app.listen(PORT, '0.0.0.0', () => {
console.log(`🔄 重定向服务器运行在: http://0.0.0.0:${PORT}`);
console.log(`🔗 访问: http://43.161.248.209:${PORT}`);
});