Rate Limiting and Cloudflare Turnstile
How to configure rate limiting and sessions to protecting your API routes from abuse.
In SuperDir, we use Redis
for rate limiting and sessions
and Cloudflare Turnstile for Anti-bot login and signup
.
Redis Configuration
You can choose any Redis cloud provider you like, such as Redis.io, Upstash. They both offer free Redis services.
To enable the feature, please add the environment variables in your .env
file:
Cloudflare Turnstile Configuration
On Cloudflare Turnstile, you can add a new Turnstile widget
and add your-website.com
and localhost
hostname.
To enable the feature, please add the environment variables in your .env
file:
They are all optional, but we recommend turning them on