Hello Developers, all of us know the value of middlewares in any framework.
Some people call it interceptors, in spring boot it is called filterchain. In frameworks like laravel, TrishulAPI it is called middleware.
Work of Middleware:
To intercept the incoming request and outgoing response.
Use Case:
AuthMiddleware: To authenticate the request before it reaches to any controller.
LogMiddleware: To log the incoming request and outgoing response.
How to create middleware in TrishulApi?