Welcome to Part 10 of the NestJS Basics course.
In the previous post, we looked at the middleware functions in NestJS. The main topics were as follows:
What is a middleware function?
How to apply a NestJS middleware function?
method-level
route wildcards
excluding routes
multiple middleware functions
Class-based middleware to functional middleware
Global middleware
If you haven’t gone through it yet, you can check out the post on the NestJS Middleware below:
In today’s post, I’m going to cover the topic of interceptors in NestJS.
The Plan
Here are the things we will cover in this post.
What is a NestJS interceptor?
Understanding the concept of Aspect-Oriented Programming
Creating a NestJS Interceptor
Binding the Interceptor
controller-scoped
method-scoped
global-scoped
As usual, every step will be accompanied by appropriate code examples.
Let’s begin.