Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"start": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js",
"start-windows": "set DEBUG=hackboard:* && set NODE_ENV=test && nodemon --ignore gcp_creds.json ./bin/www.js",
"start-windows": "set DEBUG=hackboard:* && set NODE_ENV=development && nodemon --ignore gcp_creds.json ./bin/www.js",
"deploy": "NODE_ENV=deployment node ./bin/www.js",
"debug": "DEBUG=hackboard:* NODE_ENV=development nodemon --ignore gcp_creds.json ./bin/www.js",
"test": "DEBUG=hackboard:* NODE_ENV=development mocha -r dotenv/config --reporter spec tests/**.js --exit",
Expand Down
4 changes: 2 additions & 2 deletions services/database.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function getUserFromEnvironment() {
}

function getPassFromEnvironment() {
return process.env.NODE_ENV === "development"
return env.isDevelopment()
? process.env.DB_PASS_DEV
: process.env.NODE_ENV === "deployment"
: env.isProduction()
? process.env.DB_PASS_DEPLOY
: process.env.DB_PASS_TEST;
}
Expand Down
2 changes: 1 addition & 1 deletion services/env.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
return result;
},
isDevelopment: function() {
return process.env.NODE_ENV === "development";
return process.env.NODE_ENV.trim() === "development";
},
isProduction: function() {
return process.env.NODE_ENV === "deployment";
Expand Down
Loading