fix: route Vercel traffic to the Express app - #9
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 955798bab2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "rewrites": [ | ||
| { | ||
| "source": "/(.*)", | ||
| "destination": "/api/index" |
There was a problem hiding this comment.
Route the rewrite to the actual index function
In a Vercel deployment with this api/index.js entrypoint, the index function is mounted at /api, not /api/index; the Vercel Express guide’s rewrite for this layout uses destination: "/api", and the project-config docs describe rewrite destinations as URL paths to API routes such as /api/sharp. With the current catch-all rewrite, every production request is sent to a non-existent /api/index route, so the deployment can still return 404 instead of reaching the Express app.
Useful? React with 👍 / 👎.
Summary
Verification