| 1 | import { Global, Module } from '@nestjs/common' |
| 2 | import { APP_FILTER } from '@nestjs/core' |
| 3 | import { config } from '../../../config' |
| 4 | import { ChannelsModule } from '../channels.module' |
| 5 | import { RelayClientService } from './relay-client.service' |
| 6 | import { RelayExceptionFilter } from './relay-exception.filter' |
| 7 | |
| 8 | @Global() |
| 9 | @Module({ |
| 10 | imports: [ChannelsModule], |
| 11 | providers: [ |
| 12 | { |
| 13 | provide: APP_FILTER, |
| 14 | useFactory: (relayClientService: RelayClientService) => |
| 15 | new RelayExceptionFilter(config.relay, config.assets, relayClientService), |
| 16 | inject: [RelayClientService], |
| 17 | }, |
| 18 | ], |
| 19 | }) |
| 20 | export class RelayModule {} |
| 21 |