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 { throwError } from "rxjs";
import { catchError } from "rxjs/operators"; import { catchError } from "rxjs/operators";
import { AppSettings } from "src/app/model/config/app-settings"; import { AppSettings } from "src/app/model/config/app-settings";
import { environment } from "src/environments/environment";
@Injectable({ @Injectable({
providedIn: "root", providedIn: "root",
@ -15,7 +16,7 @@ export class SettingsService {
loadSettings(): Promise<void> { loadSettings(): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.http this.http
.get<AppSettings>("/assets/config.json") .get<AppSettings>(`/assets/config/${environment.config}`)
.pipe( .pipe(
catchError((error) => { catchError((error) => {
reject(error); reject(error);

View File

@ -9,12 +9,12 @@
} }
], ],
"api": { "api": {
"url": "http://localhost:5000/api" "url": ""
}, },
"keycloak": { "keycloak": {
"url": "https://keycloak.maxlan.de", "url": "",
"realm": "develop", "realm": "",
"clientId": "lan-maestro-client-local" "clientId": ""
}, },
"loadingScreen": { "loadingScreen": {
"background": "https://www.sh-edraft.de/wp-content/uploads/2020/03/IMG_20170731_213039-scaled.jpg", "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 = { export const environment = {
production: false, production: false,
config: "config.json",
}; };

View File

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

View File

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

View File

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

View File

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