changed URL configs for frontend

This commit is contained in:
Rajat Soni
2019-08-27 18:03:26 +05:30
parent 2dd1b69221
commit 685f46b2a7
2 changed files with 49 additions and 19 deletions

View File

@@ -11,25 +11,40 @@ let dashboardUrl = null;
let domain = null;
let adminDashboardUrl = null;
// if (!isServer) {
// if (window.location.href.indexOf('localhost') > -1) {
// apiUrl = 'http://localhost:3002';
// dashboardUrl = 'http://localhost:3000';
// domain = 'localhost';
// adminDashboardUrl = 'http://localhost:3100';
// } else if (window.location.href.indexOf('staging') > -1) {
// apiUrl = 'https://staging-api.fyipe.com';
// dashboardUrl = 'http://staging-dashboard.fyipe.com';
// domain = 'fyipe.com';
// } else {
// apiUrl = 'https://api.fyipe.com';
// dashboardUrl = 'https://dashboard.fyipe.com';
// domain = 'fyipe.com';
// }
// }
if (!isServer) {
if (window.location.href.indexOf('localhost') > -1) {
apiUrl = 'http://localhost:3002';
dashboardUrl = 'http://localhost:3000';
accountsUrl = 'http://localhost:3003';
domain = 'localhost';
adminDashboardUrl = 'http://localhost:3100';
} else if (window.location.href.indexOf('staging') > -1) {
apiUrl = 'https://staging-api.fyipe.com';
dashboardUrl = 'http://staging-dashboard.fyipe.com';
domain = 'fyipe.com';
} else {
apiUrl = 'https://api.fyipe.com';
dashboardUrl = 'https://dashboard.fyipe.com';
domain = 'fyipe.com';
apiUrl = 'http://backend:3002';
dashboardUrl = 'http://dashboard:3000';
accountsUrl = 'http://accounts:3003';
domain = 'local';
}
}
export const API_URL = apiUrl;
export const DASHBOARD_URL = dashboardUrl;

View File

@@ -5,17 +5,32 @@ import valid from 'card-validator';
let apiUrl = null;
let dashboardUrl = null;
if (window.location.href.indexOf('localhost') > -1) {
apiUrl = 'http://localhost:3002';
dashboardUrl = 'http://localhost:3000'
} else if (window.location.href.indexOf('staging') > -1) {
apiUrl = 'https://staging-api.fyipe.com';
dashboardUrl = 'http://staging-dashboard.fyipe.com'
} else {
apiUrl = 'https://api.fyipe.com';
dashboardUrl = 'https://fyipe.com';
// if (window.location.href.indexOf('localhost') > -1) {
// apiUrl = 'http://localhost:3002';
// dashboardUrl = 'http://localhost:3000'
// } else if (window.location.href.indexOf('staging') > -1) {
// apiUrl = 'https://staging-api.fyipe.com';
// dashboardUrl = 'http://staging-dashboard.fyipe.com'
// } else {
// apiUrl = 'https://api.fyipe.com';
// dashboardUrl = 'https://fyipe.com';
// }
if (!isServer) {
if (window.location.href.indexOf('localhost') > -1) {
apiUrl = 'http://localhost:3002';
dashboardUrl = 'http://localhost:3000';
accountsUrl = 'http://localhost:3003';
domain = 'localhost';
} else {
apiUrl = 'http://backend:3002';
dashboardUrl = 'http://dashboard:3000';
accountsUrl = 'http://accounts:3003';
domain = 'local';
}
}
export const API_URL = apiUrl;
export const DASHBOARD_URL = dashboardUrl;