set environmentService baseUrl on self host

This commit is contained in:
Kyle Spearrin 2018-07-19 17:27:02 -04:00
parent 59f5304d87
commit 65860b166f
1 changed files with 3 additions and 0 deletions

View File

@ -115,6 +115,9 @@ containerService.attachToWindow(window);
export function initFactory(): Function {
return async () => {
const isDev = platformUtilsService.isDev();
if (!isDev && platformUtilsService.isSelfHost()) {
environmentService.baseUrl = window.location.origin;
}
await apiService.setUrls({
base: isDev ? null : window.location.origin,
api: isDev ? 'http://localhost:4000' : null,