How to connect with username/password to mongodb using native node.js driver
Easier if you just use MongoClient MongoClient.connect(‘mongodb://admin:password@localhost:27017/db’, function (err, db) {
Easier if you just use MongoClient MongoClient.connect(‘mongodb://admin:password@localhost:27017/db’, function (err, db) {
Normally you should run a node app in production like this: NODE_ENV=production node app.js Applications with Express, Socket.IO and other use process.env.NODE_ENV to figure out the environment. In development you can omit that and just run the app normally with node app.js. You can detect the environment in your code like this: var env = … Read more