Index JS code showing instead of the homepage 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 and some resource links to learn more.

Hey @ishanjarwal, we have a guide that can help you get an Express help configured for use in Serverless Functions. That should help you get the project deployed successfully.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.