Skip to content

How to modify the rate limit settings for BTE TRAPI API

JIWEN XIN edited this page May 6, 2021 · 1 revision
  1. Go to config file at: https://github.com/biothings/BioThings_Explorer_TRAPI/blob/master/src/config/index.js
  2. Go to the setLimiter function
  3. Currently set as max 3 requests/min/IP
const limiter = rateLimit({`
   windowMs: 1 * 60 * 1000, //1min`
   max: process.env.MAX_QUERIES_PER_MIN || 3 //3 requests`
});
  1. You can modify the values of windowMs or max to overwrite the default settings.
  2. Detailed documentations can be found at: https://www.npmjs.com/package/express-rate-limit