diff options
Diffstat (limited to 'lib')
| -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"), |
