Skip to content

Commit

Permalink
add stats sever
Browse files Browse the repository at this point in the history
* add stats sever

* remove stats staging url
  • Loading branch information
CKrawczyk authored and rogerhutchings committed Apr 4, 2016
1 parent b175499 commit f2c0632
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ var SUGAR_HOSTS = {
staging: 'https://notifications-staging.zooniverse.org',
};

var STAT_HOSTS = {
production: 'https://stats.zooniverse.org'
};

var hostFromBrowser = locationMatch(/\W?panoptes-api-host=([^&]+)/);
var appFromBrowser = locationMatch(/\W?panoptes-api-application=([^&]+)/);
var talkFromBrowser = locationMatch(/\W?talk-host=([^&]+)/);
var sugarFromBrowser = locationMatch(/\W?sugar-host=([^&]+)/);
var statFromBrowser = locationMatch(/\W?stat-host=([^&]+)/);

var hostFromShell = process.env.PANOPTES_API_HOST;
var appFromShell = process.env.PANOPTES_API_APPLICATION;
var talkFromShell = process.env.TALK_HOST;
var sugarFromShell = process.env.SUGAR_HOST;
var statFromShell = process.env.STAT_HOST;

var envFromBrowser = locationMatch(/\W?env=(\w+)/);
var envFromShell = process.env.NODE_ENV;
Expand All @@ -50,6 +56,7 @@ module.exports = {
clientAppID: appFromBrowser || appFromShell || API_APPLICATION_IDS[env],
talkHost: talkFromBrowser || talkFromShell || TALK_HOSTS[env],
sugarHost: sugarFromBrowser || sugarFromShell || SUGAR_HOSTS[env],
statHost: statFromBrowser || statFromShell || STAT_HOSTS[env],
oauthHost: OAUTH_HOSTS[env],
};

Expand Down

0 comments on commit f2c0632

Please sign in to comment.