Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const app = require("../src/app");

module.exports = app;
8 changes: 8 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rewrites": [
{
"source": "/(.*)",
"destination": "/api/index"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

}
]
}
Loading