Products:
Redis
Stack:
Flask
Use Case:
Ratelimit, OpenAI
Languages:
Python
Platforms:
Vercel
Publisher:

Ratelimiting python serverless functions on Vercel

Demo

Demo on Vercel

Getting Started

Prerequisites

In order to run this locally, you will need python installed and an Upstash Redis database. If you don't have a database ready, you can learn how to do it here

Quickstart

  1. Clone the repo

    $ git clone https://github.com/upstash/examples.git
    $ cd examples/ratelimiting-python-vercel
    
  2. Create the project on Vercel

    $ vercel
    
  3. Enter your secrets in Vercel

    UPSTASH_REDIS_REST_URL=""
    UPSTASH_REDIS_REST_TOKEN=""
    
  4. Deploy to production

    $ vercel --prod
    
  5. Visit the URL provided by Vercel and refresh a few times until you get ratelimited

Learn More

To learn more about Upstash and its services, check out the following resources: