|
| 1 | +const configEnvConstants = function(ENV) { |
| 2 | + const constants = {} |
| 3 | + |
| 4 | + if (ENV === 'DEV') { |
| 5 | + Object.assign(constants, { |
| 6 | + API_URL : 'https://api.topcoder-dev.com/v3', |
| 7 | + API_URL_V2 : 'https://api.topcoder-dev.com/v2', |
| 8 | + WORK_API_URL : 'https://api-work.topcoder-dev.com/v3', |
| 9 | + INTERNAL_API_URL : 'https://internal-api.topcoder-dev.com/v3', |
| 10 | + ASSET_PREFIX : 'https://s3.amazonaws.com/app.topcoder-dev.com/', |
| 11 | + AUTH_API_URL : 'https://api.topcoder-dev.com/v3', |
| 12 | + auth0Callback : 'https://api.topcoder-dev.com/pub/callback.html', |
| 13 | + auth0Domain : 'topcoder-dev.auth0.com', |
| 14 | + clientId : process.env.AUTH0_CLIENT_ID_DEV, |
| 15 | + AUTH0_DOMAIN : 'topcoder-dev.auth0.com', |
| 16 | + AUTH0_CLIENT_ID : process.env.AUTH0_CLIENT_ID_DEV, |
| 17 | + domain : 'topcoder-dev.com', |
| 18 | + DOMAIN : 'topcoder-dev.com', |
| 19 | + ENV : 'DEV', |
| 20 | + |
| 21 | + NEW_RELIC_APPLICATION_ID: process.env.TRAVIS_BRANCH ? '8957921' : '', |
| 22 | + |
| 23 | + ARENA_URL : '//arena.topcoder-dev.com', |
| 24 | + BLOG_LOCATION : 'https://www.topcoder-dev.com/feed/', |
| 25 | + COMMUNITY_URL : '//community.topcoder-dev.com', |
| 26 | + FORUMS_APP_URL : '//apps.topcoder-dev.com/forums', |
| 27 | + HELP_APP_URL : 'help.topcoder-dev.com', |
| 28 | + MAIN_URL : 'https://www.topcoder-dev.com', |
| 29 | + PHOTO_LINK_LOCATION: 'https://community.topcoder-dev.com', |
| 30 | + SWIFT_PROGRAM_URL : 'apple.topcoder-dev.com', |
| 31 | + TCO16_URL : 'http://tco16.topcoder-dev.com', |
| 32 | + TCO17_URL : 'http://tco17.topcoder-dev.com', |
| 33 | + TCO_HOME_URL : 'https://www.topcoder-dev.com/tco', |
| 34 | + |
| 35 | + ACCOUNTS_APP_URL : 'https://accounts.topcoder-dev.com/#!/member', |
| 36 | + ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder-dev.com/connector.html', |
| 37 | + |
| 38 | + FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_DEV, |
| 39 | + FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-dev', |
| 40 | + |
| 41 | + SALESFORCE_PROJECT_LEAD_LINK: 'https://c.cs18.visual.force.com/apex/ConnectLead?connectProjectId=', |
| 42 | + |
| 43 | + CONNECT_SEGMENT_KEY: 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n', |
| 44 | + PREDIX_PROGRAM_ID : 3448, |
| 45 | + IBM_COGNITIVE_PROGRAM_ID : 3449, |
| 46 | + HEAP_ANALYTICS_APP_ID : '4153837120' |
| 47 | + }) |
| 48 | + } |
| 49 | + |
| 50 | + if (ENV === 'QA') { |
| 51 | + Object.assign(constants, { |
| 52 | + API_URL : 'https://api.topcoder-qa.com/v3', |
| 53 | + API_URL_V2 : 'https://api.topcoder-qa.com/v2', |
| 54 | + WORK_API_URL : 'https://api-work.topcoder-qa.com/v3', |
| 55 | + INTERNAL_API_URL : 'https://internal-api.topcoder-qa.com/v3', |
| 56 | + ASSET_PREFIX : 'https://s3.amazonaws.com/app.topcoder-qa.com/', |
| 57 | + AUTH_API_URL : 'https://api.topcoder-qa.com/v3', |
| 58 | + auth0Callback : 'https://api.topcoder-qa.com/pub/callback.html', |
| 59 | + auth0Domain : 'topcoder-qa.auth0.com', |
| 60 | + clientId : process.env.AUTH0_CLIENT_ID_QA, |
| 61 | + AUTH0_DOMAIN : 'topcoder-qa.auth0.com', |
| 62 | + AUTH0_CLIENT_ID : process.env.AUTH0_CLIENT_ID_QA, |
| 63 | + domain : 'topcoder-qa.com', |
| 64 | + DOMAIN : 'topcoder-qa.com', |
| 65 | + ENV : 'QA', |
| 66 | + |
| 67 | + NEW_RELIC_APPLICATION_ID: process.env.TRAVIS_BRANCH ? '11199233' : '', |
| 68 | + |
| 69 | + ARENA_URL : '//arena.topcoder-qa.com', |
| 70 | + BLOG_LOCATION : 'https://www.topcoder-qa.com/feed/', |
| 71 | + COMMUNITY_URL : '//community.topcoder-qa.com', |
| 72 | + FORUMS_APP_URL : '//apps.topcoder-qa.com/forums', |
| 73 | + HELP_APP_URL : 'help.topcoder-qa.com', |
| 74 | + MAIN_URL : 'https://www.topcoder-qa.com', |
| 75 | + PHOTO_LINK_LOCATION: 'https://community.topcoder-qa.com', |
| 76 | + SWIFT_PROGRAM_URL : 'apple.topcoder-qa.com', |
| 77 | + TCO16_URL : 'http://tco16.topcoder-qa.com', |
| 78 | + TCO17_URL : 'http://tco17.topcoder-qa.com', |
| 79 | + TCO_HOME_URL : 'https://www.topcoder-dev.com/tco', |
| 80 | + |
| 81 | + ACCOUNTS_APP_URL : 'https://accounts.topcoder-qa.com/#!/member', |
| 82 | + ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder-qa.com/connector.html', |
| 83 | + |
| 84 | + FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_QA, |
| 85 | + FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-qa', |
| 86 | + |
| 87 | + SALESFORCE_PROJECT_LEAD_LINK: 'https://c.cs18.visual.force.com/apex/ConnectLead?connectProjectId=', |
| 88 | + CONNECT_SEGMENT_KEY: '', |
| 89 | + PREDIX_PROGRAM_ID : 3448, |
| 90 | + IBM_COGNITIVE_PROGRAM_ID : 3449, |
| 91 | + HEAP_ANALYTICS_APP_ID : '4153837120' |
| 92 | + }) |
| 93 | + } |
| 94 | + |
| 95 | + if (ENV === 'PROD') { |
| 96 | + Object.assign(constants, { |
| 97 | + API_URL : 'https://api.topcoder.com/v3', |
| 98 | + API_URL_V2 : 'https://api.topcoder.com/v2', |
| 99 | + WORK_API_URL : 'https://api-work.topcoder.com/v3', |
| 100 | + INTERNAL_API_URL : 'https://internal-api.topcoder.com/v3', |
| 101 | + ASSET_PREFIX : 'https://s3.amazonaws.com/app.topcoder.com/', |
| 102 | + AUTH_API_URL : 'https://api.topcoder.com/v3', |
| 103 | + auth0Callback : 'https://api.topcoder.com/pub/callback.html', |
| 104 | + auth0Domain : 'topcoder.auth0.com', |
| 105 | + clientId : process.env.AUTH0_CLIENT_ID_PROD, |
| 106 | + AUTH0_DOMAIN : 'topcoder.auth0.com', |
| 107 | + AUTH0_CLIENT_ID : process.env.AUTH0_CLIENT_ID_PROD, |
| 108 | + domain : 'topcoder.com', |
| 109 | + DOMAIN : 'topcoder.com', |
| 110 | + ENV : 'PROD', |
| 111 | + NODE_ENV : 'production', |
| 112 | + |
| 113 | + NEW_RELIC_APPLICATION_ID: process.env.TRAVIS_BRANCH ? '11352758' : '', |
| 114 | + |
| 115 | + ARENA_URL : '//arena.topcoder.com', |
| 116 | + BLOG_LOCATION : 'https://www.topcoder.com/feed/', |
| 117 | + COMMUNITY_URL : '//community.topcoder.com', |
| 118 | + FORUMS_APP_URL : '//apps.topcoder.com/forums', |
| 119 | + HELP_APP_URL : 'help.topcoder.com', |
| 120 | + MAIN_URL : 'https://www.topcoder.com', |
| 121 | + PHOTO_LINK_LOCATION: 'https://community.topcoder.com', |
| 122 | + SWIFT_PROGRAM_URL : 'apple.topcoder.com', |
| 123 | + TCO16_URL : 'http://tco16.topcoder.com', |
| 124 | + TCO17_URL : 'http://tco17.topcoder.com', |
| 125 | + TCO_HOME_URL : 'https://www.topcoder.com/tco', |
| 126 | + |
| 127 | + ACCOUNTS_APP_URL : 'https://accounts.topcoder.com/#!/member', |
| 128 | + ACCOUNTS_APP_CONNECTOR_URL : 'https://accounts.topcoder.com/connector.html', |
| 129 | + |
| 130 | + FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY_PROD, |
| 131 | + FILE_PICKER_SUBMISSION_CONTAINER_NAME: 'submission-staging-prod', |
| 132 | + |
| 133 | + SALESFORCE_PROJECT_LEAD_LINK: 'https://topcoder.my.salesforce.com/apex/ConnectLead?connectProjectId=', |
| 134 | + CONNECT_SEGMENT_KEY: 'ajP6cQ5SN2EMUWoWTOLROVnAHsOlsDCn', |
| 135 | + PREDIX_PROGRAM_ID : 3448, |
| 136 | + IBM_COGNITIVE_PROGRAM_ID : 3449, |
| 137 | + HEAP_ANALYTICS_APP_ID : '638908330' |
| 138 | + }) |
| 139 | + } |
| 140 | + |
| 141 | + return constants |
| 142 | +} |
| 143 | + |
| 144 | +module.exports = configEnvConstants |
0 commit comments