Files
gameyfin/frontend/src/app/interceptor/api-url.interceptor.ts
T
2022-07-21 00:29:00 +02:00

19 lines
523 B
TypeScript

import { Injectable } from '@angular/core';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Config } from '../config/Config';
@Injectable()
export class ApiUrlInterceptor implements HttpInterceptor {
constructor() {
}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
request = request.clone({
url: Config.apiBasePath + request.url
});
return next.handle(request);
}
}