From 365b05a34c388ab729f9e4e96f45b08a7bc46603 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 14 Jan 2023 20:26:57 +0100 Subject: [PATCH] refactor: Adjusted the chatroom-service to the changed URI's --- src/app/chatroom.service.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/chatroom.service.ts b/src/app/chatroom.service.ts index 74bda941..1099c5e2 100644 --- a/src/app/chatroom.service.ts +++ b/src/app/chatroom.service.ts @@ -11,9 +11,7 @@ export const SSE_RECONNECT_UPPER_LIMIT = 64; }) export class ChatroomService { - private uriList = 'http://localhost:8080/list'; - private uriGet = 'http://localhost:8080/get/'; - private uriListen = 'http://localhost:8080/listen/'; + private backendUri = 'http://localhost:8080/'; private channelUri: string = 'UNKNOWN'; private eventSource?: EventSource; @@ -24,15 +22,15 @@ export class ChatroomService { constructor(private http: HttpClient) { } getChatrooms(): Observable { - return this.http.get(this.uriList); + return this.http.get(this.backendUri + 'list'); } getChatroom(id: String): Observable { - return this.http.get(this.uriGet + id); + return this.http.get(this.backendUri + id); } listen(id: String): Observable { - this.channelUri = this.uriListen + id; + this.channelUri = this.backendUri + id + '/listen'; this.openChannel(); let observable = new Observable((observer) => { this.channel = observer; -- 2.20.1