Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Check in simple even exec controller
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonlal committed Dec 22, 2020
1 parent 92e8f71 commit 8d5725d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 0 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ NOTE: To be flushed out in more detail. TBD. If this PR is approved will expan

## Points, PointsConsumed, duration and blockDuration

## inmemoryBlockOnConsumed

## queueEnabled and maxQueueSize

## WhiteList and blackList
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Controller, Get } from '@nestjs/common';

import { AppService } from '../services/app.service';
import { RateLimit } from '../../../../../../dist';

@Controller('exec')
export class ExecEvenlyController {
constructor(private readonly appService: AppService) {}

@RateLimit({
points: 1,
duration: 5,
errorMessage: 'Execeed maximum number of requests' })
@Get('/evenly')
async getExecEvenly() {
const resp = await this.appService.getData();
return resp;
}
}

0 comments on commit 8d5725d

Please sign in to comment.