-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.module.ts
More file actions
52 lines (51 loc) · 1.82 KB
/
Copy pathapi.module.ts
File metadata and controls
52 lines (51 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { HealthCheckController } from './health-check/healthCheck.controller';
import { GlobalProvidersModule } from 'src/shared/global/globalProviders.module';
import { APP_GUARD } from '@nestjs/core';
import { TokenValidatorMiddleware } from 'src/core/auth/middleware/tokenValidator.middleware';
import { AuthGuard, RolesGuard } from 'src/core/auth/guards';
import { TopcoderModule } from 'src/shared/topcoder/topcoder.module';
import { OriginRepository } from './repository/origin.repo';
import { TaxFormRepository } from './repository/taxForm.repo';
import { PaymentMethodRepository } from './repository/paymentMethod.repo';
import { WinningsRepository } from './repository/winnings.repo';
import { WebhooksModule } from './webhooks/webhooks.module';
import { PaymentProvidersModule } from './payment-providers/payment-providers.module';
import { AdminModule } from './admin/admin.module';
import { WinningsModule } from './winnings/winnings.module';
import { UserModule } from './user/user.module';
import { WalletModule } from './wallet/wallet.module';
import { WithdrawalModule } from './withdrawal/withdrawal.module';
@Module({
imports: [
GlobalProvidersModule,
TopcoderModule,
PaymentProvidersModule,
WebhooksModule,
AdminModule,
WinningsModule,
UserModule,
WalletModule,
WithdrawalModule,
],
controllers: [HealthCheckController],
providers: [
{
provide: APP_GUARD,
useClass: AuthGuard,
},
{
provide: APP_GUARD,
useClass: RolesGuard,
},
OriginRepository,
TaxFormRepository,
PaymentMethodRepository,
WinningsRepository,
],
})
export class ApiModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(TokenValidatorMiddleware).forRoutes('*');
}
}