404: NOT_FOUND
Answered
West African Lion posted this in #help-forum
West African LionOP
I am trying to deploy my express sever on vercel , but getting the same code as my index.js file on production
How to solve it
My vercel.json file is like that {
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
]
}
How to solve it
My vercel.json file is like that {
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
]
}
6 Replies
@West African Lion I am trying to deploy my express sever on vercel , but getting the same code as my index.js file on production
How to solve it
My vercel.json file is like that {
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/index.js"
}
]
}
there are several folder structural limitations when you deploy express to vercel. follow the official guide https://vercel.com/guides/using-express-with-vercel
also vercel is serverless, so the app will behave very differently compared to a local express server
so you should use a long-running server like railway, fly.io, render or digitalocean to host this app instead
vercel is suitable for serverless-compatible frameworks only, express is not one of them
West African LionOP
Typing mistake vercen.json
Answer