Skip to content

fix: route Vercel traffic to the Express app - #9

Merged
maoyouaa merged 1 commit into
mainfrom
fix/vercel-express-routing
May 9, 2026
Merged

fix: route Vercel traffic to the Express app#9
maoyouaa merged 1 commit into
mainfrom
fix/vercel-express-routing

Conversation

@maoyouaa

@maoyouaa maoyouaa commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a Vercel function entrypoint that exports the Express app
  • add a rewrite so production traffic reaches the Node app instead of returning 404

Verification

  • npm test

@vercel

vercel Bot commented May 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cpt304-taskify-coursework Ready Ready Preview, Comment May 9, 2026 7:11am

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@maoyouaa
maoyouaa merged commit c5b642d into main May 9, 2026
4 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread vercel.json
"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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants