Welcome to another important concept and that is express media where.
To better understand express you need to understand Major World because Express is all about Meadow
World.
So let's see what Express Meadow World is all about.
Where Express Meadow works are functions that have access to the request object and then the response
object.
If a function can have access to the request object and then the response object.
It tells you how important it is and with the same word it can be used to modify the request object
before they are passed to the next meadow world or before it can get into our route.
So let's see importance of many words and some of the use cases here.
Well, one of the use cases of many words is to implement what is called authorization.
There is differences between authorization and authentication.
Authentication simply means that allowing a user to log in into your system with the right credentials,
email and password if the details are valid and after logging in, what do you want the user to take
inside your application?
And that is what you call authorization.
And we can use middleware to implement authorization.
And after that we can also implement middleware to do what is called login, meaning we can display
custom messages upon each request and we can also use middleware for error handling.
And you talk about all these ones.
After that, we can use middleware to implement what is called rate limiting.
This simply means that let's say we have an endpoint or route for fetching or posts, we can implement
it in such a way that a user can make a request five times that endpoint.
If you make a request, that list is six times.
We are going to, through errors that you have, exceed the request limit and we can use express middleware
to implement that.
You see how awesome middleware is and not all.
We can use middleware to implement what is called data validation.
So for the application that we built, we haven't implement what is called validation, whether the
user is providing the right data or not, and we can use express middleware to implement data validation.
And the cool part about Express middleware is that we can use you to implement any business logic.
So if you understand middleware, you can do a lot of in your application.
So let's say that if your account is on a starter account, then you can create, let's see, five posts
or three posts.
And if your account is a account, then we can allow you to create unlimited posts and we can get that
one done using what is called medium well.
The next video, let's talk more about how middleware works and the next middleware that we spoke about
in the previous video, which is this next module.
Let's get into that in the next video.