New frontend config for webserver url to fix static asset httpGet.
Removed "absolute" from config names.
This commit is contained in:
@@ -23,13 +23,13 @@ export class ApiService {
|
||||
}
|
||||
this.apiBaseUrl = API_BASE_URL.replace('{network}', network ? '/' + network : '');
|
||||
if (!stateService.isBrowser) {
|
||||
this.apiBaseUrl = this.stateService.env.BACKEND_ABSOLUTE_URL + this.apiBaseUrl;
|
||||
this.apiBaseUrl = this.stateService.env.BACKEND_URL + this.apiBaseUrl;
|
||||
}
|
||||
});
|
||||
|
||||
this.apiBaseUrl = API_BASE_URL.replace('{network}', '');
|
||||
if (!stateService.isBrowser) {
|
||||
this.apiBaseUrl = this.stateService.env.BACKEND_ABSOLUTE_URL + this.apiBaseUrl;
|
||||
this.apiBaseUrl = this.stateService.env.BACKEND_URL + this.apiBaseUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { shareReplay } from 'rxjs/operators';
|
||||
import { StateService } from './state.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -13,9 +14,15 @@ export class AssetsService {
|
||||
|
||||
constructor(
|
||||
private httpClient: HttpClient,
|
||||
private stateService: StateService,
|
||||
) {
|
||||
this.getAssetsJson$ = this.httpClient.get('/resources/assets.json').pipe(shareReplay());
|
||||
this.getAssetsMinimalJson$ = this.httpClient.get('/resources/assets.minimal.json').pipe(shareReplay());
|
||||
this.getMiningPools$ = this.httpClient.get('/resources/pools.json').pipe(shareReplay());
|
||||
let baseApiUrl = '';
|
||||
if (!this.stateService.isBrowser) {
|
||||
baseApiUrl = this.stateService.env.STATIC_WEBSERVER_URL;
|
||||
}
|
||||
|
||||
this.getAssetsJson$ = this.httpClient.get(baseApiUrl + '/resources/assets.json').pipe(shareReplay());
|
||||
this.getAssetsMinimalJson$ = this.httpClient.get(baseApiUrl + '/resources/assets.minimal.json').pipe(shareReplay());
|
||||
this.getMiningPools$ = this.httpClient.get(baseApiUrl + '/resources/pools.json').pipe(shareReplay());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class ElectrsApiService {
|
||||
private stateService: StateService,
|
||||
) {
|
||||
if (!stateService.isBrowser) {
|
||||
API_BASE_URL = this.stateService.env.ELECTRS_ABSOLUTE_URL;
|
||||
API_BASE_URL = this.stateService.env.ELECTRS_URL + '/api';
|
||||
}
|
||||
this.apiBaseUrl = API_BASE_URL.replace('{network}', '');
|
||||
this.stateService.networkChanged$.subscribe((network) => {
|
||||
|
||||
@@ -21,8 +21,10 @@ export interface Env {
|
||||
SPONSORS_ENABLED: boolean;
|
||||
ELECTRS_ITEMS_PER_PAGE: number;
|
||||
KEEP_BLOCKS_AMOUNT: number;
|
||||
BACKEND_ABSOLUTE_URL?: string;
|
||||
ELECTRS_ABSOLUTE_URL?: string;
|
||||
BACKEND_URL?: string;
|
||||
ELECTRS_URL?: string;
|
||||
ELECTRS_URL_SERVER?: string;
|
||||
STATIC_WEBSERVER_URL?: string;
|
||||
}
|
||||
|
||||
const defaultEnv: Env = {
|
||||
|
||||
Reference in New Issue
Block a user