I have an expressTS backend that I want to deploy on Vercel, I wanted to use vercel locally to be sure it runs ok before deploying. I installed vercel, did vercel login and then vercel dev configuring the project. When I follow the link given in the terminal in VS Code I have the error 502: BAD_GATEWAY Code: NO_RESPONSE_FROM_FUNCTION.
When running the code with npm run dev, without vercel, I have the message back in the browser.
I tried so many different configuration of the vercel.json file, below are the latest I tried:
`{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "src/server.ts" }] }`
The latest I have now on vercel.json is:
"version": 2,
"builds": [{ "src": "src/server.ts", "use": "@vercel/node" }],
"routes": [
{
"src": "/(.*)",
"dest": "src/server.ts"
}
]
}
I wanted to mention that the project has a dist folder where the ts files are compiled into js and also the src folder with the .ts filesversel.json file structurepackage.json scriptsconfig.tsserver.tsbrowser errorerror in the terminal
Please see the pictures attached.
So sorry if my post is too obvious. I am am beginner and really struggle.
Thanks a lot!
user24756977 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.