Skip to content

Commit

Permalink
Merge pull request #39 from Inist-CNRS/fix/cleanup
Browse files Browse the repository at this point in the history
Cleanup logs and file limit rate
  • Loading branch information
AlasDiablo authored May 16, 2024
2 parents 298fba8 + af38e3f commit 1cbe71f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tdm-be/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const limiter = rateLimit({
limit: 2000, // Limit each IP to 1000 requests per `window` (here, per 10 minutes)
standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers
legacyHeaders: false, // Disable the `X-RateLimit-*` headers
validate: {
trustProxy: false, // Enable being behind a proxy server
},
});
app.use(limiter);

Expand All @@ -41,7 +44,7 @@ const auth = basicAuth({
});

app.use((req, res, next) => {
httpLogger.info(`${req.method} ${req.url} - ${req.ip} - ${req.get('user-agent')}`);
httpLogger.debug(`${req.method} ${req.url} - ${req.ip} - ${req.get('user-agent')}`);
next();
});

Expand Down

0 comments on commit 1cbe71f

Please sign in to comment.