Skip to content

Commit

Permalink
Merge pull request #23 from zooniverse/fix-env-var-on-config-mk2
Browse files Browse the repository at this point in the history
Alternate fix for `env` variable in lib/config.js
  • Loading branch information
brian-c committed Feb 5, 2016
2 parents 7737061 + 34057e7 commit 42b2107
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ var envFromShell = process.env.NODE_ENV;

var env = envFromBrowser || envFromShell || DEFAULT_ENV;

if (!env.match(/^(production|staging|cam)$/)) {
throw new Error('Panoptes Javascript Client Error: Invalid Environment; ' +
'try setting NODE_ENV to "staging" instead of "'+envFromShell+'".');
}

module.exports = {
host: hostFromBrowser || hostFromShell || API_HOSTS[env],
clientAppID: appFromBrowser || appFromShell || API_APPLICATION_IDS[env],
Expand Down

0 comments on commit 42b2107

Please sign in to comment.