I've been working on a Node.js project for several months and for some reason the logic I have set up stopped working. I'm not sure where to begin debugging the issue. My workaround has been to comment out the development lines when pushing to production.
var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
if(env === 'development'){
mongoose.connect('mongodb://localhost:27017/mean-demo');
}else{
mongoose.connect('mongodb://username:password@ds043270.mongolab.com:ds043270/location');
}