How do I setup MongoDB database on Heroku with MongoLab?
I'm using Express.js and MongoLab and I followed the Heroku setup to get MongoDB working in production throwing this code in my app.js . //Mongo on Heroku Setup var mongo = require('mongodb'); var mongoUri = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || 'mongodb://localhost/mydb'; mongo.Db.connect(mongoUri, function (err, db) { db.collection('mydocs', function(er, collection) { collection.insert({'mykey': 'myvalue'}, {safe: true}, function(er,rs) { }); }); }); and I have the following routes and field for my email form (also in app.js): //Routes app.get('/', function(req, res) { res