-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.module.ts
52 lines (49 loc) · 1.7 KB
/
app.module.ts
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 './boilerplate.polyfill';
import type { MiddlewareConsumer, NestModule } from '@nestjs/common';
import { Module, RequestMethod } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { JsonBodyMiddleware } from './middlewares/json-body.middleware';
import { RawBodyMiddleware } from './middlewares/raw-body.middleware';
import AuthModule from './modules/auth/auth.module';
import { ServicesConfigModule } from './modules/config/config.module';
import HealthModule from './modules/health/health.module';
import { LogModule } from './modules/log/log.module';
import ServiceRegistryModule from './modules/service-registry/service-registry.module';
import { SubscriptionsModule } from './modules/subscriptions/subscriptions.module';
import { UserModule } from './modules/users/user.module';
import { SharedModule } from './shared/shared.module';
import { InvoiceModule } from './modules/invoices/invoice.module';
import { ScheduleModule } from '@nestjs/schedule';
import { RelayActionModule } from './modules/relay-action/relay-action.module';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
}),
ScheduleModule.forRoot(),
AuthModule,
SharedModule,
UserModule,
HealthModule,
ServiceRegistryModule,
ServicesConfigModule,
SubscriptionsModule,
LogModule,
InvoiceModule,
RelayActionModule,
],
controllers: [],
providers: [],
})
export class AppModule implements NestModule {
public configure(consumer: MiddlewareConsumer): void {
consumer
.apply(RawBodyMiddleware)
.forRoutes({
path: '/subscriptions/webhook',
method: RequestMethod.POST,
})
.apply(JsonBodyMiddleware)
.forRoutes('*');
}
}