feat: 网关上传转对象存储(FS 适配器、8MB 上限、防路径穿越)

This commit is contained in:
lovefyf
2026-08-13 05:17:53 +08:00
parent 0159c3a7eb
commit d8b59330fb
6 changed files with 120 additions and 0 deletions
+3
View File
@@ -2,11 +2,14 @@ import { Hono } from 'hono';
import { healthRoute, registerHealthCheck } from './health';
import { checkNats } from '../shared/bus/nats';
import { proxyRoutes } from '../modules/proxy/routes';
import { uploadRoutes } from '../modules/upload/routes';
export function buildApp(): Hono {
registerHealthCheck('nats', checkNats);
const app = new Hono();
app.route('/health', healthRoute()); // 公开:不过 requireAuth
// 顺序要紧:/api/upload 必须先于 /api 代理挂载,否则被代理的 catch-all 吞掉
app.route('/api/upload', uploadRoutes());
app.route('/api', proxyRoutes());
return app;
}