phase-8g: rate limiting and update readme doc
This commit is contained in:
committed by
saikiranvella
parent
5af9ded35e
commit
d1556f2a67
@@ -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) {
|
||||
|
||||
@@ -8,8 +8,16 @@ export class ScreenerController {
|
||||
constructor(private readonly engine: ScreenerEngine) {}
|
||||
|
||||
register(app: FastifyInstance): void {
|
||||
app.post('/api/screen', { schema: screenSchema }, this.screen.bind(this));
|
||||
app.get('/api/screen/catalysts', this.catalysts.bind(this));
|
||||
app.post(
|
||||
'/api/screen',
|
||||
{ schema: screenSchema, config: { rateLimit: { max: 10, timeWindow: '1 minute' } } },
|
||||
this.screen.bind(this),
|
||||
);
|
||||
app.get(
|
||||
'/api/screen/catalysts',
|
||||
{ config: { rateLimit: { max: 10, timeWindow: '1 minute' } } },
|
||||
this.catalysts.bind(this),
|
||||
);
|
||||
}
|
||||
|
||||
private static serializeAssets(arr: LiveAssetResult[]) {
|
||||
|
||||
Reference in New Issue
Block a user