aboutsummaryrefslogtreecommitdiffstats
path: root/lib/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-03-23 00:30:52 -0700
committerAdam Soltys <[email protected]>2024-03-23 00:49:30 -0700
commit5fe1fc6ed3cee0e01d0aa732f8c5b6a9c47e93f1 (patch)
treeb318689d687a6639e3ae03593f6cc98ebfee6a08 /lib/app.js
parentf9a442a175e2d19df48137046f4ec28d07560ff8 (diff)
downloadcoinos-server-5fe1fc6ed3cee0e01d0aa732f8c5b6a9c47e93f1.tar.gz
coinos-server-5fe1fc6ed3cee0e01d0aa732f8c5b6a9c47e93f1.zip
don't rate limit static resources
Diffstat (limited to 'lib/app.js')
-rw-r--r--lib/app.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index 337b2e96..5019cda3 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -20,7 +20,8 @@ const app = fastify({
});
await app.register(import("@fastify/rate-limit"), {
- max: 50,
+ allowList: (req, key) => req.raw.url.includes("public"),
+ max: 100,
timeWindow: 2000,
keyGenerator: (req) => req.headers["cf-connecting-ip"],
});