Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
scttcper committed Feb 1, 2020
1 parent e12221f commit c25fce9
Show file tree
Hide file tree
Showing 9 changed files with 2,426 additions and 2,911 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module.exports = {
rules: {
'object-curly-spacing': ['error', 'always'],
'@typescript-eslint/indent': ['error', 2, { SwitchCase: 1 }],
'@typescript-eslint/explicit-function-return-type': 0,
'capitalized-comments': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'comma-dangle': ['error', 'always-multiline'],
},
};
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"printWidth": 100,
"arrowParens": "avoid"
}
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
jobs:
test:
docker:
- image: circleci/node:10
- image: circleci/node:12
- image: circleci/redis
steps:
- checkout
Expand Down Expand Up @@ -30,7 +30,7 @@ jobs:
path: jest
release:
docker:
- image: circleci/node:10
- image: circleci/node:12
steps:
- checkout
- restore_cache:
Expand Down
20 changes: 11 additions & 9 deletions example.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import Koa from 'koa';
import redis from 'redis';

import ratelimit from './src';
import { ratelimit } from './src';

const app = new Koa();

// Apply rate limit

app.use(ratelimit({
db: redis.createClient(),
duration: 60000,
max: 100
}));
app.use(
ratelimit({
db: redis.createClient(),
duration: 60000,
max: 100,
}),
);

// Response middleware

app.use((ctx, next) => {
ctx.body = 'Stuff!';
return next();
app.use(async (ctx, next) => {
ctx.body = 'Stuff!';
return next();
});

app.listen(4000);
Expand Down
Loading

0 comments on commit c25fce9

Please sign in to comment.