Reputation: 17
I am trying to do the following:
So far I have only connected it to Mongo Atlas and I dont know how to do both of them at the same time.
Upvotes: 0
Views: 65
Reputation: 26
Use enviroment varialbles.
Define env variables in your project using .env.
e.g in .env
file use
DEVELOPMENT=true
and check if it's local or Heroku
if (process.env.DEVELOPMENT) {
conenctToLocalDB();
}else{
connectToAtlas();
}
Upvotes: 1