diff --git a/lib/config.js b/lib/config.js index 6e24a72..3ac33bc 100644 --- a/lib/config.js +++ b/lib/config.js @@ -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],