Welcome to the Part 9 of NestJS Basics.
In the previous post, we looked at the API Documentation using Swagger & NestJS. The main topics were as follows:
What is Swagger?
Initializing the Swagger module
Setting the Proper API Tags
The role of generic interface
The
catch()
method
If you haven’t gone through it yet, you can check out the post on the NestJS Swagger integration below:
In today’s post, I’m going to cover the topic of middleware functions in NestJS.
The Plan
Here are the things we will cover in this post.
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
As usual, every step will be accompanied by appropriate code examples.
Let’s begin.