Load config by env
This commit is contained in:
parent
fe509af0e6
commit
78e8a3e703
1
web/.gitignore
vendored
Normal file
1
web/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
config.*.json
|
@ -3,6 +3,7 @@ import { Injectable } from "@angular/core";
|
||||
import { throwError } from "rxjs";
|
||||
import { catchError } from "rxjs/operators";
|
||||
import { AppSettings } from "src/app/model/config/app-settings";
|
||||
import { environment } from "src/environments/environment";
|
||||
|
||||
@Injectable({
|
||||
providedIn: "root",
|
||||
@ -15,7 +16,7 @@ export class SettingsService {
|
||||
loadSettings(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http
|
||||
.get<AppSettings>("/assets/config.json")
|
||||
.get<AppSettings>(`/assets/config/${environment.config}`)
|
||||
.pipe(
|
||||
catchError((error) => {
|
||||
reject(error);
|
||||
|
@ -9,12 +9,12 @@
|
||||
}
|
||||
],
|
||||
"api": {
|
||||
"url": "http://localhost:5000/api"
|
||||
"url": ""
|
||||
},
|
||||
"keycloak": {
|
||||
"url": "https://keycloak.maxlan.de",
|
||||
"realm": "develop",
|
||||
"clientId": "lan-maestro-client-local"
|
||||
"url": "",
|
||||
"realm": "",
|
||||
"clientId": ""
|
||||
},
|
||||
"loadingScreen": {
|
||||
"background": "https://www.sh-edraft.de/wp-content/uploads/2020/03/IMG_20170731_213039-scaled.jpg",
|
@ -4,4 +4,5 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
config: "config.json",
|
||||
};
|
||||
|
@ -4,4 +4,5 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
config: "config.local.json",
|
||||
};
|
||||
|
@ -4,4 +4,5 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
config: "config.json",
|
||||
};
|
||||
|
@ -4,4 +4,5 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
config: "config.json",
|
||||
};
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
config: "config.json",
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user