UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

81 lines (41 loc) 1.65 kB
--- lang: en title: 'API docs: core.application.interceptor' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/core permalink: /doc/en/lb4/apidocs.core.application.interceptor.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/core](./core.md) &gt; [Application](./core.application.md) &gt; [interceptor](./core.application.interceptor.md) ## Application.interceptor() method Register an interceptor **Signature:** ```typescript interceptor(interceptor: Interceptor | Constructor<Provider<Interceptor>>, nameOrOptions?: string | InterceptorBindingOptions): Binding<Interceptor>; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> interceptor </td><td markdown="1"> [Interceptor](./context.interceptor.md) \| [Constructor](./context.constructor.md)<!-- -->&lt;[Provider](./context.provider.md)<!-- -->&lt;[Interceptor](./context.interceptor.md)<!-- -->&gt;&gt; </td><td markdown="1"> An interceptor function or provider class </td></tr> <tr><td markdown="1"> nameOrOptions </td><td markdown="1"> string \| [InterceptorBindingOptions](./context.interceptorbindingoptions.md) </td><td markdown="1"> _(Optional)_ Binding name or options </td></tr> </tbody></table> **Returns:** [Binding](./context.binding.md)<!-- -->&lt;[Interceptor](./context.interceptor.md)<!-- -->&gt;