From: Kai Moritz Date: Sat, 14 Jan 2023 19:26:57 +0000 (+0100) Subject: refactor: Adjusted the chatroom-service to the changed URI's X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=365b05a34c388ab729f9e4e96f45b08a7bc46603;p=demos%2Fkafka%2Fchat refactor: Adjusted the chatroom-service to the changed URI's --- 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;