Search code examples
mongodbnext.jsdeploymentweb-applicationsvercel

Mongo DB doesn't connect to web after deployment via vercel


I got an issue with my web app after deployment via vercel which is that my web app equipped with mongo DB while in development the mongo DB connects to the app well but after deployment in vercel it doesn't connect to app

But before deployment it suggests to reduce the function running time like from 300s to 10s since I got basic plan in vercel

I have tried checking the .env and other mongo DB params in my web app but still the deployed web app doesn't connect to mongo DB


Solution

  • The issue was resolved by making the MongoDB access from anywhere which is whitelisting the IP which allows it to access the DB but the vercel function running time is still reduced to 10 which is from 300 because it's a free tier