This commit is contained in:
Eugene Pankov
2021-07-25 14:00:22 +02:00
parent d9d019e15f
commit e11193b807
24 changed files with 961 additions and 193 deletions

View File

@@ -0,0 +1,18 @@
import { Injectable } from '@angular/core'
@Injectable({ providedIn: 'root' })
export class CommonService {
private backendURL?: string
async getBackendURL (): Promise<string> {
if (!this.backendURL) {
const config = await (await fetch('/config.json')).json()
this.backendURL = config.backendURL
if (this.backendURL.endsWith('/')) {
this.backendURL = this.backendURL.slice(0, -1)
}
}
return this.backendURL
}
}