Load config by env

This commit is contained in:
Sven Heidemann 2025-01-03 14:51:08 +01:00
parent fe509af0e6
commit 78e8a3e703
8 changed files with 12 additions and 5 deletions

1
web/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
config.*.json

View File

@ -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);

View File

@ -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",

View File

@ -4,4 +4,5 @@
export const environment = {
production: false,
config: "config.json",
};

View File

@ -4,4 +4,5 @@
export const environment = {
production: false,
config: "config.local.json",
};

View File

@ -4,4 +4,5 @@
export const environment = {
production: false,
config: "config.json",
};

View File

@ -4,4 +4,5 @@
export const environment = {
production: false,
config: "config.json",
};

View File

@ -4,6 +4,7 @@
export const environment = {
production: false,
config: "config.json",
};
/*