1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 01:34:43 -05:00

add ratelimits :3

This commit is contained in:
Ashley 2023-08-24 19:34:52 +00:00
parent 5dfeb84bb1
commit 6c15fc8b5f

View file

@ -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