Skip to content

Instantly share code, notes, and snippets.

@fedor
Created September 13, 2016 08:32
Show Gist options
  • Save fedor/a1b9aef659963a062785fd559da4299e to your computer and use it in GitHub Desktop.
Save fedor/a1b9aef659963a062785fd559da4299e to your computer and use it in GitHub Desktop.
// config.js
module.exports = {
mongo: {
init: function (params) {
return require('mongodb').MongoClient.connect(
'mongodb://'+params.host+':'+params.port+'/'+params.db
)
},
default: {
db: 'test',
port: 27017
},
development: {
host: '127.0.0.1'
},
production: {
db: 'prod',
host: '192.168.0.10'
}
},
redis: {
init: function (params) {
return require('redis').createClient(params)
},
default: {
port: 6379
},
development: {
host: '127.0.0.1'
},
production: {
host: '192.168.0.11'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment