# Middleware

Middlewares are functions that allow them to be executed before any route.

Example:

```typescript
router.use((req, res) => {
  req.executionStart = performance.now();
});
```

Multiple middlewares can be nested

```typescript
router
  .use((req, res) => {
    // Middleware 1
  })
  .use((req, res) => {
    // Middleware 2
  })
  .use((req, res) => {
    // Middleware 3
  });
```

> NOTE: Remember that middlewares run according to the order that were created.
