Skip to content
Snippets Groups Projects
Commit c13ef429 authored by Helmut Hutzler's avatar Helmut Hutzler
Browse files

Tesing apiUrl keycloakURL for prod

parent 8886ae19
Branches
No related tags found
No related merge requests found
Pipeline #9090 failed
...@@ -4,6 +4,7 @@ import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http"; ...@@ -4,6 +4,7 @@ import {HttpClient, HttpErrorResponse, HttpHeaders} from "@angular/common/http";
import {map, Observable, of, tap, throwError} from 'rxjs'; import {map, Observable, of, tap, throwError} from 'rxjs';
import { retry, catchError } from 'rxjs/operators'; import { retry, catchError } from 'rxjs/operators';
import { Account } from './account'; import { Account } from './account';
import { environment } from '../environments/environment';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -13,7 +14,8 @@ export class AccountService { ...@@ -13,7 +14,8 @@ export class AccountService {
constructor(public messageService: MessageService, constructor(public messageService: MessageService,
private http: HttpClient) { } private http: HttpClient) { }
private logHeader = '' private logHeader = ''
private apiURL = 'http://localhost:8080/api'; private apiURL = environment.apiURL;
'http://localhost:8080/api';
private preferredUsername = 'No User'; private preferredUsername = 'No User';
private httpOptions = { private httpOptions = {
...@@ -29,8 +31,9 @@ export class AccountService { ...@@ -29,8 +31,9 @@ export class AccountService {
getAccountsObservableApi(): Observable<any> { getAccountsObservableApi(): Observable<any> {
this.logHeader = '[AccountService:getAccountsObservable()] '; this.logHeader = '[AccountService:getAccountsObservable()] ';
let appUrl = this.apiURL + '/kc/getusers'; let appUrl = this.apiURL + '/kc/getusers';
this.messageService.add(this.logHeader + 'appUrl: ' + appUrl);
return this.http.get<any>(appUrl ).pipe( return this.http.get<any>(appUrl ).pipe(
tap((data:any) => this.messageService.add(this.logHeader + ' Retrieving all Accounts Observable')), tap((data:any) => this.messageService.add(this.logHeader + ' xx Retrieving all Accounts Observable')),
// catchError takes in an input Observable, and outputs an Output Observable. // catchError takes in an input Observable, and outputs an Output Observable.
catchError(this.handleError(this.logHeader)) catchError(this.handleError(this.logHeader))
); );
...@@ -39,6 +42,7 @@ export class AccountService { ...@@ -39,6 +42,7 @@ export class AccountService {
getAccountsObservable(): Observable<any> { getAccountsObservable(): Observable<any> {
this.logHeader = '[AccountService:getAccountsObservableRest()] '; this.logHeader = '[AccountService:getAccountsObservableRest()] ';
let appUrl = this.apiURL + '/accounts' ; let appUrl = this.apiURL + '/accounts' ;
this.messageService.add(this.logHeader + ' Retrieving all Accounts: - appUrL: ' + appUrl );
return this.http.get<any>(appUrl,this.httpOptions ).pipe( return this.http.get<any>(appUrl,this.httpOptions ).pipe(
tap((data:any) => this.messageService.add(this.logHeader + ' Retrieving all Accounts Observable')), tap((data:any) => this.messageService.add(this.logHeader + ' Retrieving all Accounts Observable')),
// catchError takes in an input Observable, and outputs an Output Observable. // catchError takes in an input Observable, and outputs an Output Observable.
......
...@@ -2,6 +2,6 @@ export const environment = { ...@@ -2,6 +2,6 @@ export const environment = {
production: true, production: true,
//keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/', //keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/',
keycloakURL: '/auth/', keycloakURL: '/auth/',
apiURL: 'http://localhost:8080/api' apiURL: '/api'
}; };
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
export const environment = { export const environment = {
production: false, production: false,
// keycloakURL: 'http://localhost:8280/auth/' // keycloakURL: 'http://localhost:8280/auth/'
keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/' // keycloakURL: '/auth/',
keycloakURL: 'https://kube-master-h1.informatik.fh-nuernberg.de:/auth/',
apiURL: 'http://localhost:8080/api'
}; };
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment