# Handler middlewares

This file provides handler middlewares the exported unit is based on middy interface.

This folder also provide the service common middleware attached to all handlers using the `initCommonMiddlewares` function.

[Middy package](https://github.com/middyjs/middy)

## Middleware example

```typescript
interface IExampleMiddlewareOptions {}

export const exampleMiddleware = (options: IExampleMiddlewareOptions) => {
    return {
        before: async handler => {
            // code
        },
        after: async handler => {
            // code
        },
        onError: async handler => {
            // code
        }
    } as middy.IMiddyMiddlewareObject;
};
```
