mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
- Add JSDoc comments across frontend and backend modules - Improve code readability and maintainability with consistent documentation style - Document Electron IPC handlers, UI utilities, and theme system - Add missing function/class documentation in theme loader and app services - Minor structural improvements and cleanup across Electron main process modules - Minor fixes on variable names
24 lines
529 B
JavaScript
24 lines
529 B
JavaScript
const RateLimit = require("express-rate-limit");
|
|
|
|
|
|
/**
|
|
* Rate limiter middleware used to protect public endpoints
|
|
* against abusive or excessive requests.
|
|
*
|
|
* Restrictions:
|
|
* - 5 requests per IP address
|
|
* - 15-minute sliding window
|
|
*
|
|
* When the limit is exceeded, a HTTP 429 (Too Many Requests)
|
|
* response is returned.
|
|
*/
|
|
const rateLimit = RateLimit({
|
|
windowMs: 15 * 60 * 1000, // 15 minutes
|
|
max: 5,
|
|
message: "Too many requests, please try again later.",
|
|
statusCode: 429,
|
|
});
|
|
|
|
module.exports = {
|
|
rateLimit
|
|
} |