Moved BaseUrl from appsettings.json to Database and fixed an issue in UI for setting base url based on a hack, rather than asking backend for it. (#644)
This commit is contained in:
parent
e8e838d125
commit
977e364d5a
10 changed files with 52 additions and 26 deletions
|
@ -2,13 +2,21 @@ import { enableProdMode } from '@angular/core';
|
|||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app/app.module';
|
||||
import { ConfigData } from './app/_models/config-data';
|
||||
import { environment } from './environments/environment';
|
||||
|
||||
|
||||
|
||||
if (environment.production) {
|
||||
enableProdMode();
|
||||
}
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||
.catch(err => console.error(err));
|
||||
function fetchConfig(): Promise<ConfigData> {
|
||||
return fetch(environment.apiUrl + 'settings/base-url')
|
||||
.then(response => response.text())
|
||||
.then(response => new ConfigData(response));
|
||||
}
|
||||
|
||||
fetchConfig().then(config => {
|
||||
platformBrowserDynamic([ { provide: ConfigData, useValue: config } ])
|
||||
.bootstrapModule(AppModule)
|
||||
.catch(err => console.error(err));
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue