As title.
I am learning Nest.js.
there are many provider in nest ,
such as middleware、pipe、guard、interceptor.
For me ,they are middleware.
How to distinguish their usage scenario.
Thanks all.
each one has its specific usage
for example :
we use Gards when we want to give acces conditions to an end point or a global controller for example we want the service "update user" to be only called by admins (user with role Admin)
we use Pipes to transform the input data to a specific form or to validate some inputs
learn more here in nestJs doccumentation