I have split my Vue.js project into two parts:
The frontend is a Vue app, which I successfully deployed to Netlify, and it works fine.
The backend is a simple Node.js + Express server that I want to deploy to Vercel.
Inside the backend folder, I created a vercel.json file with the following content:
{
"version": 2,
"builds": [
{
"src": "backend/server.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "backend/server.js"
}
]
}
I pushed everything to GitHub and then connected the repository to Vercel. The deployment finishes without build errors, but when I open the backend URL in the browser, I only get:
404: NOT_FOUND
Code: NOT_FOUND
What I have tried so far:
Placing
vercel.jsoninside the backend folder.Moving
vercel.jsonto the project root.Changing the src path from
backend/server.jsto justserver.js.Redeploying multiple times.