phase-8g: rate limiting and update readme doc

This commit is contained in:
Kazuma
2026-06-05 23:02:21 -04:00
committed by Kazuma
parent 8bdcb422aa
commit ca449b4300
7 changed files with 320 additions and 184 deletions
+5 -1
View File
@@ -10,7 +10,11 @@ export class AnalyzeController {
) {}
register(app: FastifyInstance): void {
app.post('/api/analyze', { schema: analyzeSchema }, this.analyze.bind(this));
app.post(
'/api/analyze',
{ schema: analyzeSchema, config: { rateLimit: { max: 10, timeWindow: '1 minute' } } },
this.analyze.bind(this),
);
}
private async analyze(req: FastifyRequest, reply: FastifyReply) {