Refine auth, API proxy, and server routing

This commit is contained in:
Developer
2026-05-18 15:16:46 +08:00
parent 4ad1766f10
commit d10dd53884
9 changed files with 88 additions and 17 deletions
+4 -3
View File
@@ -31,9 +31,6 @@ app.use(cors({
}));
app.use(express.json());
app.use(express.static(path.join(__dirname, '../public')));
app.use(express.static(path.join(__dirname, '../frontend/.next')));
app.use(express.static(path.join(__dirname, '../frontend/.next/server/pages')));
// 请求日志
app.use((req, res, next) => {
@@ -55,6 +52,10 @@ app.get('/api/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
app.use(express.static(path.join(__dirname, '../public')));
app.use(express.static(path.join(__dirname, '../frontend/.next')));
app.use(express.static(path.join(__dirname, '../frontend/.next/server/pages')));
// 前端路由 - Next.js 静态文件
app.get('/_next/static/:path(*)', (req, res) => {
const filePath = path.join(__dirname, '../frontend/.next/static', req.params.path);