diff options
| author | Adam Soltys <[email protected]> | 2024-03-05 15:28:48 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-03-05 15:28:48 -0800 |
| commit | 2967b5994469ec83faba99135b696e4367cab67a (patch) | |
| tree | 869d852efa19227c24b04bf6a4f45d54d4e11b7b /lib | |
| parent | c1641e80d3dc113e4adbc48c1bc8e54a5fd68f7c (diff) | |
| download | coinos-server-2967b5994469ec83faba99135b696e4367cab67a.tar.gz coinos-server-2967b5994469ec83faba99135b696e4367cab67a.zip | |
rate limiting
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/app.js | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -19,6 +19,12 @@ const app = fastify({ maxParamLength: 500, }); +await app.register(import("@fastify/rate-limit"), { + max: 50, + timeWindow: 5000, + keyGenerator: (req) => req.headers["cf-connecting-ip"], +}); + app.register(fastifySecureSession, { key: Buffer.from(config.jwt, "hex"), }); |
