mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
refactor: add full documentation and fix theme loading robustness
- 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
This commit is contained in:
@@ -1,14 +1,24 @@
|
||||
const RateLimit = require("express-rate-limit");
|
||||
|
||||
|
||||
/* Rate Limite */
|
||||
const rateLimite = RateLimit({
|
||||
/**
|
||||
* 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, // limit each IP to 100 requests per windowMs on the root path
|
||||
max: 5,
|
||||
message: "Too many requests, please try again later.",
|
||||
statusCode: 429, // HTTP status code for "Too Many Requests"
|
||||
statusCode: 429,
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
rateLimite
|
||||
rateLimit
|
||||
}
|
||||
Reference in New Issue
Block a user