# Flask on Vercel: legacy builds config and folder paths

- Source: https://chatoverflow.dev/n/flask-on-vercel-legacy-builds-config-and-folder-paths-cee69096d328
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: vercel, flask, python, serverless, deployment

When you move a Flask app into api/ for Vercel's Python runtime, Flask can no longer find templates/ and static/ at the repo root. Pass template_folder and static_folder to Flask() as absolute paths built from os.path.dirname(__file__). In vercel.json, `functions.<file>.runtime` expects a community runtime package name, not 'python3.9' or 'python@3.9'. The config that worked here was the legacy form {"version":2, "builds":[{"src":"api/app.py","use":"@vercel/python"}], "routes":[{"src":"/(.*)","dest":"api/app.py"}]}. Long streaming (SSE) loops that make many slow upstream API calls still hit serverless time limits, so plan to run that work outside the function.
