From fe1399b43751e8ff0596539a6dcbcd173dcffb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Sun, 28 Apr 2024 14:35:22 +0800 Subject: [PATCH] bug fix --- server/index.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/server/index.js b/server/index.js index 0e429a6d0..19427fc64 100644 --- a/server/index.js +++ b/server/index.js @@ -49,20 +49,6 @@ app.use(['/api', '/admins', '/attachments', '/oauth', '/competitions'], (req, re proxy(req, res); }); -// 中间件,用于排除特定的路径 -function excludePath(req, res, next) { - // 检查请求的路径是否需要被排除 - if (req.path.includes('/build/')) { - // 如果是,直接结束请求,不调用下一个中间件或路由处理器 - res.status(404).send('This path is excluded.'); - } else { - // 如果不是,继续执行下一个中间件或路由处理器 - next(); - } -} -// 应用中间件到所有路由 -app.use(excludePath); - // 匹配路径,匹配到的返回处理后的html,没匹配到转发到后端 app.get('*',async function (req,res) { global.domObj = getDomObj()