diff options
| author | Adam Soltys <[email protected]> | 2024-08-25 05:03:20 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-08-25 05:03:23 +0000 |
| commit | c5c201b441e0b1ef7d0df19bd936d0ccfa9e601c (patch) | |
| tree | 4929300229dc38c676f9deb0a44d0974806f3c85 /lib/app.js | |
| parent | 2a60293dd7e1c04df37660e5df2604c43bcad000 (diff) | |
| download | coinos-server-c5c201b441e0b1ef7d0df19bd936d0ccfa9e601c.tar.gz coinos-server-c5c201b441e0b1ef7d0df19bd936d0ccfa9e601c.zip | |
squelch rate errors
Diffstat (limited to 'lib/app.js')
| -rw-r--r-- | lib/app.js | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -24,6 +24,13 @@ await app.register(import("@fastify/rate-limit"), { max: 100, timeWindow: 2000, keyGenerator: (req) => req.headers["cf-connecting-ip"], + errorResponseBuilder: (req, context) => { + return { + statusCode: 429, + error: "Too Many Requests", + message: "Rate limit exceeded, retry in 2 seconds", + }; + }, }); app.register(fastifySecureSession, { @@ -35,7 +42,7 @@ app.register(fastifyPassport.secureSession()); fastifyPassport.use("jwt", jwtStrategy); - app.register(fastifyMultipart, { limits: { fileSize: 10 ** 7}}); +app.register(fastifyMultipart, { limits: { fileSize: 10 ** 7 } }); app.register(fastifyStatic, { root: path.join("/app/data/uploads"), |
