Relative Content

Tag Archive for node.jsdeploymentmernvercel

index js code appears on the home page in vercel deployment

I am working on an ecommerce app using mern stack.
I tried deploying it on vercel but for some reason the homepage shows the index js code and no other routes work, neither the api routes nor the react router routes.
I am pretty sure there is something wrong in the vercel.json. I didn’t find any tutorial on vercel.json
Here is the repo link : https://github.com/ishanjarwal/mern-sneaker-store
Folder Structure : in the root, there are two folders : api and client. the api folder contains a dist for react’s build. the api folder is what I want to be deployed and I don’t want a seperate repo with api as the root folder.
Please give a solution along with explaination.