This commit is contained in:
lik
2026-11-06 21:01:56 +08:00
parent af9a1543ae
commit adaf10376d
3 changed files with 43 additions and 1 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ class APP {
// 同时提供 /health/static,避免独立 /static 请求落到其他服务的默认响应
this.app.use(mount('/health/static', serve(STATIC_DIR)));
this.app.use(mount('/static', serve(STATIC_DIR)));
this.app.use(cors());
// Web 后台(escort.huashengtec.com)跨域直连时需要 PATCH,koa-cors 默认不含
this.app.use(cors({ methods: 'GET,HEAD,PUT,POST,DELETE,PATCH' }));
this.app.use((ctx, next) => {
const parser = LARGE_BODY_PREFIXES.some((prefix) => ctx.path.startsWith(prefix))
? largeBodyParser