My server is not started when i deploy my full stack application on the vercel

21 Views Asked by At

I want to deply my full stack app on the vercel so i make a build command which create a buil for me "build": "npm install --legacy-peer-deps && npm install --legacy-peer-deps --prefix frontend && npm run build --prefix frontend " and when i locally do this it will run the application correctly because after complete the build i start the script npm start which run the server and application works correctly but in case of deployment when i deployed it on the vercel it create a build then it donot start the server but application deployed successfully and when i make any request on it then it give 404 error server responded with 404 not found... So i add the npm start at the end of build command so when it complete the build then it start the server auto but it start the server before the deployment is completed and after start the server it continously do the deploying means that it donot complete the deployment process i also try different approaches by using vercel.json({ "routes": [ { "src": "/api/.", "dest": "backend/server.js" }, { "src": "/.", "dest": "frontend/build/index.html" } ] } ) but it donot work ...... I stuck here for 5 days

I try many different ways by using vercel.json file and make other scripts but it donot give the expected outpu

0

There are 0 best solutions below