mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 03:28:35 +01:00
add ratelimits :3
This commit is contained in:
parent
5dfeb84bb1
commit
6c15fc8b5f
1 changed files with 8 additions and 1 deletions
|
@ -61,9 +61,16 @@
|
|||
);
|
||||
|
||||
const sha384 = modules.hash;
|
||||
const rateLimit = require("express-rate-limit");
|
||||
|
||||
|
||||
const limiter = rateLimit({
|
||||
windowMs: 30 * 1000, // 30 Seconds
|
||||
max: 870, // limit each IP to 870 requests per windowMs
|
||||
});
|
||||
|
||||
var app = modules.express();
|
||||
app.use(limiter);
|
||||
initlog("Loaded express.js");
|
||||
app.engine("html", require("ejs").renderFile);
|
||||
app.use(modules.express.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
|
||||
|
|
Loading…
Reference in a new issue