mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat: Initialize the Express server with essential middleware, security, authentication, routing, and service configurations.
This commit is contained in:
1 parent
6d16dc9d41
commit
a71c5a278f
1 file changed
+4
-4
+4
-4
@@ -39,19 +39,19 @@ app.use(helmet({
|
||||
crossOriginEmbedderPolicy: false,
|
||||
}));
|
||||
|
||||
// Rate limiting global - 100 requêtes par 15 minutes par IP
|
||||
// Rate limiting global - 1000 requêtes par 15 minutes par IP
|
||||
const globalLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
max: 100,
|
||||
max: 1000,
|
||||
message: { error: 'Trop de requêtes, réessayez plus tard' },
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
});
|
||||
|
||||
// Rate limiting strict pour l'authentification - 5 tentatives par 15 minutes
|
||||
// Rate limiting pour l'authentification - 30 tentatives par 15 minutes
|
||||
const authLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
max: 5,
|
||||
max: 30,
|
||||
message: { error: 'Trop de tentatives de connexion, réessayez dans 15 minutes' },
|
||||
standardHeaders: true,
|
||||
legacyHeaders: false,
|
||||
|
||||
Reference in new issue
Block a user