Frontend config support for AU. New absolute server url settings.

refs #104
This commit is contained in:
softsimon
2020-11-23 02:30:46 +07:00
parent bd1440ce96
commit d2cd595da6
16 changed files with 68 additions and 66 deletions

View File

@@ -3,7 +3,6 @@ import { HttpClient, HttpParams } from '@angular/common/http';
import { OptimizedMempoolStats } from '../interfaces/node-api.interface';
import { Observable } from 'rxjs';
import { StateService } from './state.service';
import { env } from '../app.constants';
import { WebsocketResponse } from '../interfaces/websocket.interface';
const API_BASE_URL = '{network}/api/v1';
@@ -19,18 +18,18 @@ export class ApiService {
private stateService: StateService,
) {
this.stateService.networkChanged$.subscribe((network) => {
if (network === 'bisq' && !env.BISQ_SEPARATE_BACKEND) {
if (network === 'bisq' && !this.stateService.env.BISQ_SEPARATE_BACKEND) {
network = '';
}
this.apiBaseUrl = API_BASE_URL.replace('{network}', network ? '/' + network : '');
if (!stateService.isBrowser) {
this.apiBaseUrl = 'http://localhost:8999' + this.apiBaseUrl;
this.apiBaseUrl = this.stateService.env.BACKEND_ABSOLUTE_URL + this.apiBaseUrl;
}
});
this.apiBaseUrl = API_BASE_URL.replace('{network}', '');
if (!stateService.isBrowser) {
this.apiBaseUrl = 'http://localhost:8999' + this.apiBaseUrl;
this.apiBaseUrl = this.stateService.env.BACKEND_ABSOLUTE_URL + this.apiBaseUrl;
}
}