argos/dmp-frontend/src/common/http/common-http.module.ts

61 lines
1.6 KiB
TypeScript

import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { AuthTokenInterceptor } from './interceptors/auth-token.interceptor';
import { JsonInterceptor } from './interceptors/json.interceptor';
import { LocaleInterceptor } from './interceptors/locale.interceptor';
import { ProgressIndicationInterceptor } from './interceptors/progress-indication.interceptor';
import { RequestTimingInterceptor } from './interceptors/request-timing.interceptor';
import { ResponsePayloadInterceptor } from './interceptors/response-payload.interceptor';
import { UnauthorizedResponseInterceptor } from './interceptors/unauthorized-response.interceptor';
import { StatusCodeInterceptor } from './interceptors/status-code.interceptor';
@NgModule({
imports: [
],
declarations: [
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: AuthTokenInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: JsonInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: LocaleInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: UnauthorizedResponseInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: RequestTimingInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: ProgressIndicationInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: ResponsePayloadInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: StatusCodeInterceptor,
multi: true,
}
]
})
export class CommonHttpModule { }