Compare commits
2 commits
e7da5de255
...
ed66f264ff
Author | SHA1 | Date | |
---|---|---|---|
ed66f264ff | |||
b6f909ee5d |
1 changed files with 5 additions and 2 deletions
|
@ -15,7 +15,10 @@ const app = express.Router();
|
||||||
const createAccountLimiter = rateLimit({
|
const createAccountLimiter = rateLimit({
|
||||||
windowMs: 60 * 60 * 1000, // 1 hour window
|
windowMs: 60 * 60 * 1000, // 1 hour window
|
||||||
max: 10, // start blocking after 5 requests
|
max: 10, // start blocking after 5 requests
|
||||||
message: "You are being rate limited"
|
message: JSON.stringify({
|
||||||
|
error: true,
|
||||||
|
message: "ERROR_RATE_LIMITED"
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
mongoose.connect(config.mongoUrl, {useNewUrlParser: true, useUnifiedTopology: true});
|
mongoose.connect(config.mongoUrl, {useNewUrlParser: true, useUnifiedTopology: true});
|
||||||
|
|
Reference in a new issue