37 lines
958 B
TypeScript
37 lines
958 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { ConfigService } from '@nestjs/config';
|
|
import {
|
|
WalletController,
|
|
LedgerController,
|
|
DepositController,
|
|
HealthController,
|
|
} from './controllers';
|
|
import { WalletApplicationService } from '@/application/services';
|
|
import { JwtStrategy } from '@/shared/strategies/jwt.strategy';
|
|
|
|
@Module({
|
|
imports: [
|
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
JwtModule.registerAsync({
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService) => ({
|
|
secret: config.get<string>('JWT_SECRET') || 'default-secret',
|
|
signOptions: { expiresIn: '7d' },
|
|
}),
|
|
}),
|
|
],
|
|
controllers: [
|
|
WalletController,
|
|
LedgerController,
|
|
DepositController,
|
|
HealthController,
|
|
],
|
|
providers: [
|
|
WalletApplicationService,
|
|
JwtStrategy,
|
|
],
|
|
})
|
|
export class ApiModule {}
|