Skip to content

Commit

Permalink
Merge 716f545 into b0f0f0d
Browse files Browse the repository at this point in the history
  • Loading branch information
r0nni3 committed Apr 3, 2018
2 parents b0f0f0d + 716f545 commit 94420e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/mocksConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

function generateConfig() {
const env = process.env.NODE_ENV || "development";
const host = process.env.MONGODB_HOST || "localhost";
const port = process.env.MONGODB_PORT || 27017;
let db = process.env.MONGODB_DB || "mockSQS";

if (env === "test") {
return {
db: process.env.MOCK_SQS_DB || "mongodb://localhost:27017/mockSQS_test",
};
db = `${db}_${env}`;
}

return {
db: process.env.MOCK_SQS_DB || "mongodb://localhost:27017/mockSQS",
db: process.env.MOCK_SQS_DB || `mongodb://${host}:${port}/${db}`,
};
}

Expand Down

0 comments on commit 94420e0

Please sign in to comment.