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 { 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);
|
||||||
|
@ -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",
|
@ -4,4 +4,5 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
|
config: "config.json",
|
||||||
};
|
};
|
||||||
|
@ -4,4 +4,5 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
|
config: "config.local.json",
|
||||||
};
|
};
|
||||||
|
@ -4,4 +4,5 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
|
config: "config.json",
|
||||||
};
|
};
|
||||||
|
@ -4,4 +4,5 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
|
config: "config.json",
|
||||||
};
|
};
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
|
config: "config.json",
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user