This project demonstrates how to deploy a simple Flask web application on Vercel. It provides an example of integrating a Python backend with Vercel’s serverless platform, enabling fast and scalable deployments.
- Minimal Flask app with a sample route (
/) - Vercel configuration for seamless deployment
- Quick start instructions
- Easily customizable for your own API endpoints
-
Clone this repository
git clone https://github.com/rowink/flask-demo.git cd flask-demo -
Install dependencies
pip install -r requirements.txt
-
Run locally
cd api flask runBy default, Flask will serve at
http://127.0.0.1:5000/. -
Deploy to Vercel
Click the button below to deploy your own copy to Vercel:
Or, from the command line, if you have Vercel CLI:
vercel
- Modify
api/index.pyto add or change routes. - Install additional Python packages as needed by adding them to
requirements.txt.
- The Flask app must reside inside the
api/directory for Vercel’s Python runtime to detect it properly. - On Vercel, each request spins up a new serverless function instance, so avoid using global state.
- For more advanced configuration, edit
vercel.jsonas needed.
Happy deploying! 🚀