'Implement API Rate Limiting in NextJS deployed on Vercel without Redis

I have a public API that can make Create/Read requests to my firebase database.

I have applied cloudflare 'DNS Only' to my domain as Vercel discourages using the proxy mode.

I want to add rate limiting to my APIs but all the examples on the NextJS website are for edge functions and redis, none of which I am using. My website is rather simple.

What's the best way to implement API rate-limiting?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source