Home > Mobile >  How to deploy Next JS App with Mongoose(MongoDB) connection on Vercel?
How to deploy Next JS App with Mongoose(MongoDB) connection on Vercel?

Time:12-18

I am facing issue while deploying my next js app on vercel with mongodb connection. I have added env variable also on vercel site where we deploy next js app. Is there something going wrong in the below file ?

next.config.js

module.exports = {
  env: {
    MONGODB_URI: "mongodb://localhost/tasksdb",
  },
};

I have add env variable as well into my next js project .env.local

MONGODB_URI = "mongodb://localhost/tasksdb"

I establish this mongodb connection from this doc enter image description here See : https://www.mongodb.com/pricing

  • Related