loading...

Cap-em: Another rate limiter? πŸ˜… Limit access to resources in any configuration

ananto30 profile image Azizul Haque Ananto ・1 min read

The main concept is to track the usage of your resources, and lmit access to them.

Say you have a resource email you want to limit your users to change the email twice per day. Then you come up with some stats and want to limit users to change it once per hour and 5 times in a month. May be you can come up with more crazy configs.

Cap-em can do these out of the box. This can be deployed as a microservice and it will track and let you know the status with two very simple API's - /limit/check and /add/usage. All you need to do is make the above configuration like this - email,3600:1,86400:2,2592000:5. Put it in the config.txt file and follow the steps here to run the microservice.

You have to use a relational DB for the service to track.

Please visit the project here - https://github.com/Ananto30/cap-em

Discussion

markdown guide