set FLASK_APP=hello
set FLASK_ENV=development
This will run hello.py file as app, by default it runs app.py, there are two environments, development and production.
python -m flask run
-p for port
Flask uses jinja template engine.
pip install virtualenv
python3 -m venv venv
venv\Scripts\activate
then install required libraries(eg flask) and create a package file.
pip freeze > requirements.txt
- create a vercel.json file with following content
{
"version": 2,
"builds": [{
"src": "./hello.py",
"use": "@vercel/python"
}],
"routes": [{
"src": "/(.*)",
"dest": "/hello.py"
}]
}
-
then install required libraries(eg flask) and create a package file.
-
create requirements.txt file
pip freeze > requirements.txt
-
npx vercel --prod