Vercel Cheat Sheet
Useful Links
- Environment Variables Docs
- vercel.json Project Configuration
Configuration
Redirects for JavaScript Routers
For routers like vue-router
with history mode enabled, something like this in vercel.json
works:
"rewrites": [
{
"source": "/(.*)",
"destination": "/index.html"
}
]
Redirects for Python Functions
This (legacy) configuration is the only one that seems to work with Python at the moment:
"routes": [
{
"src": "/(.*)",
"dest": "/"
}
]
Misc
- Gotcha when adding a new project: you can’t select a branch when creating a project; it automatically uses the main branch. So if your code is not available on the main branch, yu can’t create a project for it. (Easy workaround: create whatever works, then edit all the settings afterwards.)
Tagged with cheatsheet, vercel
Published . Last modified .