Page Contents
Home > @loopback/context > registerInterceptor
registerInterceptor() function
Register an interceptor function or provider class to the given context
Signature:
export declare function registerInterceptor(ctx: Context, interceptor: Interceptor | Constructor<Provider<Interceptor>>, options?: InterceptorBindingOptions): Binding<Interceptor>;
Parameters
| Parameter | Type | Description |
|---|---|---|
|
ctx |
Context object | |
|
interceptor |
An interceptor function or provider class | |
|
options |
(Optional) Options for the interceptor binding |
Returns: