diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 9d5e98a00e..9a861d30ce 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -12,7 +12,7 @@ export const environment = { baseApiUrls: window['env']['fineractApiUrls'] || 'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443', // For connecting to server running elsewhere set the base API URL - baseApiUrl: window['env']['fineractApiUrl'] || 'https://demo.fineract.dev', + baseApiUrl: window['env']['fineractApiUrl'] || window.location.protocol + '://' + window.location.hostname, allowServerSwitch: env.allow_switching_backend_instance, apiProvider: window['env']['apiProvider'] || '/fineract-provider/api', apiVersion: window['env']['apiVersion'] || '/v1', diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 647ac24c26..3c519e02a8 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -15,9 +15,9 @@ export const environment = { fineractPlatformTenantIds: window['env']['fineractPlatformTenantIds'] || 'default', // For connecting to others servers running elsewhere update the base API URL baseApiUrls: window['env']['fineractApiUrls'] || - 'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443,http://localhost:8443', + 'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443,' + window.location.protocol + '://' + window.location.hostname + ':' + window.location.port, // For connecting to server running elsewhere set the base API URL - baseApiUrl: window['env']['baseApiUrl'] || 'https://demo.fineract.dev', + baseApiUrl: window['env']['baseApiUrl'] || window.location.protocol + '://' + window.location.hostname + ':' + window.location.port, allowServerSwitch: env.allow_switching_backend_instance, apiProvider: window['env']['apiProvider'] || '/fineract-provider/api', apiVersion: window['env']['apiVersion'] || '/v1',