changed env variable name

This commit is contained in:
Timo Bejan 2020-09-22 13:49:04 +03:00
parent 4c3d282d41
commit 16df58d754
4 changed files with 12 additions and 15 deletions

View File

@ -7,7 +7,7 @@ import {Observable} from "rxjs";
export enum AppConfigKey { export enum AppConfigKey {
KEYCLOAK_URL = "KEYCLOAK_URL", KEYCLOAK_URL = "KEYCLOAK_URL",
KEYCLOAK_REALM = "KEYCLOAK_REALM", KEYCLOAK_REALM = "KEYCLOAK_REALM",
KEYCLOAK_CLIENT_ID = "KEYCLOAK_CLIENT_ID", API_CLIENT = "API_CLIENT",
API_URL = "API_URL", API_URL = "API_URL",
} }

View File

@ -1,7 +1,7 @@
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {AppConfigService} from "../app-config/app-config.service"; import {AppConfigKey, AppConfigService} from "../app-config/app-config.service";
@Injectable() @Injectable()
export class ApiPathInterceptorService implements HttpInterceptor { export class ApiPathInterceptorService implements HttpInterceptor {
@ -11,16 +11,13 @@ export class ApiPathInterceptorService implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
// if (!req.url.startsWith('/assets')) { if (!req.url.startsWith('/assets')) {
// const updatedRequest = req.clone({ const updatedRequest = req.clone({
// url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url
// }) })
// return next.handle(updatedRequest);
// console.log(req); } else {
// return next.handle(req);
// return next.handle(updatedRequest); }
// } else {
return next.handle(req);
// }
} }
} }

View File

@ -9,7 +9,7 @@ export function keycloakInitializer(keycloak: KeycloakService, appConfigService:
config: { config: {
url: appConfigService.getConfig(AppConfigKey.KEYCLOAK_URL), url: appConfigService.getConfig(AppConfigKey.KEYCLOAK_URL),
realm: appConfigService.getConfig(AppConfigKey.KEYCLOAK_REALM), realm: appConfigService.getConfig(AppConfigKey.KEYCLOAK_REALM),
clientId: appConfigService.getConfig(AppConfigKey.KEYCLOAK_CLIENT_ID) clientId: appConfigService.getConfig(AppConfigKey.API_CLIENT)
}, },
initOptions: { initOptions: {
checkLoginIframe: false, checkLoginIframe: false,

View File

@ -1,6 +1,6 @@
{ {
"KEYCLOAK_URL": "https://keycloak-dev.iqser.cloud/auth", "KEYCLOAK_URL": "https://keycloak-dev.iqser.cloud/auth",
"KEYCLOAK_REALM": "dev", "KEYCLOAK_REALM": "dev",
"KEYCLOAK_CLIENT_ID": "gin-client", "API_CLIENT": "gin-client",
"API_URL": "" "API_URL": ""
} }