42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import {
|
|
AuthController,
|
|
SmsController,
|
|
PasswordController,
|
|
KycController,
|
|
UserController,
|
|
HealthController,
|
|
AdminController,
|
|
} from './controllers';
|
|
import { ApplicationModule } from '@/application';
|
|
import { JwtAuthGuard } from '@/shared/guards/jwt-auth.guard';
|
|
|
|
@Module({
|
|
imports: [
|
|
ApplicationModule,
|
|
JwtModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
secret: configService.get<string>('JWT_SECRET'),
|
|
signOptions: {
|
|
expiresIn: configService.get<string>('JWT_EXPIRES_IN', '7d'),
|
|
},
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
],
|
|
controllers: [
|
|
AuthController,
|
|
SmsController,
|
|
PasswordController,
|
|
KycController,
|
|
UserController,
|
|
HealthController,
|
|
AdminController,
|
|
],
|
|
providers: [JwtAuthGuard],
|
|
})
|
|
export class ApiModule {}
|