/** Angular Imports */ import { Injectable } from '@angular/core' ; import { HttpEvent , HttpInterceptor , HttpHandler , HttpRequest } from '@angular/common/http' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /** Environment Configuration */ import { environment } from 'environments/environment' ; /**
 * Http request interceptor to prefix a request with `environment.serverUrl`.
 */ @ Injectable ( ) export class ApiPrefixInterceptor implements HttpInterceptor { /**
     * Intercepts a Http request and prefixes it with `environment.serverUrl`.
     */ intercept ( request , next ) { /**
         * Ignore URLs that are complete for i18n
         */ if ( ! request . url . includes ( 'http:' ) && ! request . url . includes ( 'https:' ) ) { request = request . clone ( { url : environment . serverUrl + request . url } ) ; } return next . handle ( request ) ; } }