From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Introduction to Nest middlewares - Nest.js Tutorial
From the course: Mastering Nest.js: Build Scalable Applications with Mastery in Nest.js Framework
Introduction to Nest middlewares
In building any backend application, middlewares are essential and important. They are not a unique concept specific to NestJS though. Middlewares are used throughout every single backend application, regardless of the language or framework. It is a very common practice to utilize middleware and that is why it is also important that one should know how to use them along with NestJS as well. Middlewares are generally used for request handling by providing a way to intercept the incoming HTTP request, execute some logic, and then either pass the request to the next middleware or return a response. Now before we get into implementing a middleware, let me quickly explain what exactly a middleware is. Let's assume that we have a client that makes a request. And on the back end side, specifically with NestJS, there is a controller that handles the request and sends a response to the client. So this is a general request response pattern, followed by the client and the server or Nest…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Introduction to Nest middlewares3m 46s
-
(Locked)
Implementing middleware3m 45s
-
(Locked)
Registering a middleware5m 20s
-
(Locked)
Route-specific middleware5m 48s
-
(Locked)
Assignment: Checking Content-Type with middleware4m
-
(Locked)
Handling route wildcards3m 19s
-
(Locked)
Middleware for specific route handlers4m 38s
-
(Locked)
Excluding routes3m 49s
-
(Locked)
Controller-driven route middleware2m 15s
-
(Locked)
Understanding functional middleware4m 26s
-
(Locked)
Applying multiple middlewares6m 51s
-
(Locked)
Applying global middlewares3m 52s
-
(Locked)
Assignment: Password encryption middleware10m 19s
-
(Locked)
-
-
-
-
-
-
-
-