aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-03-24 22:34:51 -0500
committermat <27899617+mat-1@users.noreply.github.com>2021-03-24 22:34:51 -0500
commitac38c2c61dd17bd5324ab98ed5dcc7e1bfd6c754 (patch)
treec5662fc5ddbb6c740439943bb89cdd5902916171 /src/index.ts
parent859e14a96e1885b814eb99f1c5a9beb8adfdb591 (diff)
downloadskyblock-api-ac38c2c61dd17bd5324ab98ed5dcc7e1bfd6c754.tar.gz
skyblock-api-ac38c2c61dd17bd5324ab98ed5dcc7e1bfd6c754.tar.bz2
skyblock-api-ac38c2c61dd17bd5324ab98ed5dcc7e1bfd6c754.zip
increase ratelimits
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/index.ts b/src/index.ts
index fbab327..4cf8dae 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -7,12 +7,15 @@ const app = express()
export const debug = false
-// 250 requests over 5 minutes
+// 500 requests over 5 minutes
const limiter = rateLimit({
windowMs: 60 * 1000 * 5,
- max: 250,
- skip: (req: express.Request, res) => {
+ max: 500,
+ skip: (req: express.Request) => {
return req.headers.key === process.env.key
+ },
+ keyGenerator: (req: express.Request) => {
+ return (req.headers['Cf-Connecting-Ip'] ?? req.ip).toString()
}
})