主文件功能拆分

This commit is contained in:
2025-09-26 15:31:29 +08:00
parent a9dcbc2578
commit efb68fce1c
8 changed files with 284 additions and 172 deletions
+13
View File
@@ -0,0 +1,13 @@
/**
* CORS中间件配置
*/
const cors = require('cors');
function corsMiddleware() {
return cors({
origin: process.env.FRONTEND_URL || true, // 允许所有来源,或者通过环境变量指定
credentials: true,
});
}
module.exports = { corsMiddleware };