Skip to content

Commit cbdde01

Browse files
committed
shift prod config to .json
1 parent 1fc6619 commit cbdde01

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

bin/helpers/config.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
var config = {};
2-
config.env = process.env.NODE_ENV || "production";
1+
var config = require('./config.json');
32

4-
if(config.env === "production") {
5-
config.uploadUrl = 'https://api-cloud.browserstack.com/automate-frameworks/cypress/upload';
6-
config.rails_host = 'https://api.browserstack.com';
7-
config.dashboardUrl = 'https://automate.browserstack.com/dashboard/v2/builds/';
8-
config.usageReportingUrl = 'https://eds.browserstack.com:443/send_event_cy_internal';
9-
} else {
3+
config.env = process.env.NODE_ENV || "production";
104

5+
if(config.env !== "production") {
116
// load config based on env
127
require('custom-env').env(config.env);
138

149
config.uploadUrl = process.env.UPLOAD_URL;
1510
config.rails_host = process.env.RAILS_HOST;
1611
config.dashboardUrl = process.env.DASHBOARD_URL;
17-
config.usageReportingUrl = process.env.USAGE_REPORTING_URL;
12+
config.usageReportingUrl = process.env.USAGE_REPORTING_URL;
1813
}
1914

2015
config.cypress_v1 = `${config.rails_host}/automate/cypress/v1`;

bin/helpers/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"uploadUrl": "https://api-cloud.browserstack.com/automate-frameworks/cypress/upload",
3+
"rails_host": "https://api.browserstack.com",
4+
"dashboardUrl": "https://automate.browserstack.com/dashboard/v2/builds/",
5+
"usageReportingUrl": "https://eds.browserstack.com:443/send_event_cy_internal"
6+
}

0 commit comments

Comments
 (0)