Skip to content

Commit 5d4931e

Browse files
jssturmcursoragent
andcommitted
fix(vercel): route requests to the app again after rewrite semantics change
Vercel's builder (CLI 56.5.0 -> 58.1.0) changed internal rewrites in backend framework projects to route using the rewritten destination path. Every path was rewritten to /api/index, so FastAPI stopped seeing real paths: each request fell through to the SPA catch-all and returned the landing page. /app looked like a dead "Launch Plan-It" button, /health returned HTML, and /css/app.css was served as text/html. Vercel now detects this as a FastAPI project on its own, so the rewrites are redundant as well as harmful. Drop them and pin the entrypoint so detection is unambiguous between api/index.py and app/main.py. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4130add commit 5d4931e

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Issues = "https://github.com/jssturm/Plan-It/issues"
4949
[project.scripts]
5050
plan-it = "app.cli:main"
5151

52+
[tool.vercel]
53+
entrypoint = "app.main:app"
54+
5255
[tool.setuptools.packages.find]
5356
include = ["app", "app.*"]
5457

vercel.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
{
2-
"buildCommand": "pip install -r requirements.txt",
3-
"rewrites": [
4-
{ "source": "/health", "destination": "/api/index" },
5-
{ "source": "/travel", "destination": "/api/index" },
6-
{ "source": "/travel/(.*)", "destination": "/api/index" },
7-
{ "source": "/start-day", "destination": "/api/index" },
8-
{ "source": "/app", "destination": "/api/index" },
9-
{ "source": "/(.*)", "destination": "/api/index" }
10-
]
11-
}
2+
"buildCommand": "pip install -r requirements.txt"
3+
}

0 commit comments

Comments
 (0)