| 1 | import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common'; |
| 2 | import express from 'express |
| 3 | |
| 4 | import { S3Service } |
| 5 | import { UsersService } |
| 6 | import { AVATAR_CONTENT_TYPES, AVATAR_MAX_BYTES |
| 7 | import { UserController } |
| 8 | import { UserService } |
| 9 | |
| 10 | @Module({ |
| 11 | controllers: [UserController], |
| 12 | providers: [UserService, |
| 13 | }) |
| 14 | export class UserModule |
| 15 | configure(consumer: |
| 16 | consumer |
| 17 | .apply( |
| 18 | express.raw({ |
| 19 | type: Object.keys |
| 20 | limit: AVATAR_MAX_BYTES, |
| 21 | }), |
| 22 | ) |
| 23 | .forRoutes(UserController); |
| 24 | } |
| 25 | } |