Skip to content

Commit

Permalink
move database default to config.js and set it to local
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Binetsky committed Apr 22, 2017
1 parent c156464 commit 6610a44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = {
namespace: process.env.KUBE_NAMESPACE,
username: process.env.MONGODB_USERNAME,
password: process.env.MONGODB_PASSWORD,
database: process.env.MONGODB_DATABASE,
database: process.env.MONGODB_DATABASE || 'local',
loopSleepSeconds: process.env.MONGO_SIDECAR_SLEEP_SECONDS || 5,
unhealthySeconds: process.env.MONGO_SIDECAR_UNHEALTHY_SECONDS || 15,
env: process.env.NODE_ENV || 'local',
Expand Down
3 changes: 1 addition & 2 deletions src/lib/mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ var getDb = function(host, done) {
}

host = host || localhost;
var database = config.databse || "admin"
var mongoDb = new Db(database, new MongoServer(host, config.mongoPort));
var mongoDb = new Db(config.database, new MongoServer(host, config.mongoPort));
mongoDb.open(function (err, db) {
if (err) {
return done(err);
Expand Down

0 comments on commit 6610a44

Please sign in to comment.