·
55 commits
to master
since this release
@gaman/rate-limit
is the official middleware for GamanJS that limits the number of requests from clients within a specified time period.
This plugin is designed to protect applications from request spam, brute-force attacks, and overload, while maintaining stable server performance.
Installation
npm install @gaman/rate-limitBasic
import { rateLimit } from '@gaman/rate-limit';
defineBootstrap(async (app) => {
app.mount(
rateLimit({
ttl: 60_000, // 60 detik
limit: 5, // 5 klien dalam 60 detik
}),
);
});Docs: https://gaman.7togk.id/docs/security/rate-limit/
Full Changelog: https://github.com/7TogkID/gaman/compare/@gaman/[email protected]...@gaman/[email protected]