From a4944ee152b2fe60fcbdaa9d70212de4aeabd3fa Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 10 Jan 2023 23:22:27 +0100 Subject: [PATCH] refactor: use backend url in pwa service --- src/app/services/pwa.service.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/services/pwa.service.ts b/src/app/services/pwa.service.ts index 49676960a..8aefa5cfc 100644 --- a/src/app/services/pwa.service.ts +++ b/src/app/services/pwa.service.ts @@ -52,9 +52,7 @@ import { DataService } from './data.service'; }) export class PwaService extends DataService { /** Proxy URL to avoid CORS issues */ - corsProxyUrl = AppConfig.production - ? 'https://iptvnator-playlist-parser-api.vercel.app/parse?url=' - : 'http://localhost:3000/parse?url='; + corsProxyUrl = AppConfig.BACKEND_URL; appRef = inject(ApplicationRef); snackBar = inject(MatSnackBar); @@ -273,7 +271,7 @@ export class PwaService extends DataService { } else if (type === PLAYLIST_UPDATE) { this.http // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - .get(`${this.corsProxyUrl}${payload.url}`, { + .get(`${this.corsProxyUrl}/parse?url=${payload.url}`, { responseType: 'text', }) .pipe( @@ -341,7 +339,7 @@ export class PwaService extends DataService { */ fetchFromUrl(payload: Partial): void { this.http - .get(`${this.corsProxyUrl}${payload.url}`) + .get(`${this.corsProxyUrl}/parse?url=${payload.url}`) .pipe( switchMap((response) => payload.isTemporary