Kaizen Today I Learned by Ville Säävuori

Vercel Cheat Sheet

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 ,

Published . Last modified .