From 3b714fee0c8fc1ec3544131717d1918d2d5ec227 Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Tue, 21 May 2024 22:25:23 -0600 Subject: [PATCH] Support same url with subdomain as backend server url --- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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',