az-rate-limit
v2.0.3
Published
API Rate Limit for Node
Downloads
3
Maintainers
Readme
az-rate-limit
Hello I am Aawez Khan(Nodejs Community Lead Developer) [email protected].
Caching is a commonly used technique to improve the performance of any application
Cache a route Ready to use sample
var cacheService = require("az-rate-limit");
var client = cacheService.cache;
app.get("/", client("1 minutes"), (req, res) => {
// retrieve data and request before 1 minutes will get data from cache
res.json([
your response
]);
});
app.listen(5000, function () {
console.log(`Example app listening on 3000!`);
});
API
valid units
- ms, second, minute, hour, day, week, month.duration format
- [time][unit] as5 minutes