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