mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
refactor: use backend url in pwa service
This commit is contained in:
1 parent
3e3f75f421
commit
a4944ee152
1 file changed
+3
-5
@@ -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<Playlist>): void {
|
||||
this.http
|
||||
.get(`${this.corsProxyUrl}${payload.url}`)
|
||||
.get(`${this.corsProxyUrl}/parse?url=${payload.url}`)
|
||||
.pipe(
|
||||
switchMap((response) =>
|
||||
payload.isTemporary
|
||||
|
||||
Reference in new issue
Block a user