In noonjs, request rate limiting is handled using the express-rate-limit middleware to prevent abuse and ensure fair API usage. The configuration can be set through config.json or environment variables. The window option defines the time window in milliseconds during which requests are counted, and limit specifies the maximum number of allowed requests within that window. If rate limiting is not needed, you can disable it by setting it to false or removing the limiter entry from the configuration.
{
...
"limiter": {
"window": 60000,
"limit": 100
}
...
}
Alternatively, environment variables like LIMITER_WINDOW=60000 and LIMITER_LIMIT=100 achieve the same result. noonjs prioritizes environment variables over config.json. However, both parameters must be provided; if either is missing, the limiter will be ignored.