feat: add backend

This commit is contained in:
2025-08-28 23:25:59 +08:00
parent 2edf8753a7
commit 47f36cd625
29 changed files with 1489 additions and 253 deletions

View File

@@ -0,0 +1,13 @@
import type { Middleware } from './types.ts';
import type Koa from 'koa';
export class ResponseTime implements Middleware {
apply(app: Koa): void {
app.use(async (ctx, next) => {
const start = Date.now();
await next();
const ms = Date.now() - start;
ctx.set('X-Response-Time', `${ms}ms`);
});
}
}