Middlewares and Params
Middlewares
How middleware works?

When the bot gets update, it completes all middlewares, and only then completes a handler. For example, using middlewares, you can auth user and pass some params to the handler
Creating middleware
Let's create logger.middleware.ts file. It will be the middleware that will log received update. We will then apply this middleware
Global middlewares
You can apply middleware for all controller, if you are uncomfortable to set it for every handler
Last updated