mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 16:20:04 +00:00
19 lines
523 B
TypeScript
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);
|
|
}
|
|
}
|