Frontend config support for AU. New absolute server url settings.
refs #104
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user