import { HttpEvent , HttpHandler , HttpInterceptor , HttpRequest } from '@angular/common/http' ; import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { environment } from '../environments/environment' ; @ Injectable ( ) export class AuthInterceptor implements HttpInterceptor { intercept ( req , next ) { const authReq = req . clone ( { params : req . params . set ( 'apikey' , environment . apiKey ) } ) ; return next . handle ( authReq ) ; } }