dependencies Legend  Declarations  Module  Bootstrap  Providers  Exports cluster_SharedModule cluster_SharedModule_exports cluster_SharedModule_providers GeneratorService GeneratorService ValidatorService ValidatorService SharedModule SharedModule SharedModule->GeneratorService SharedModule->ValidatorService GeneratorService GeneratorService GeneratorService->SharedModule ValidatorService ValidatorService ValidatorService->SharedModule

File

src/modules/shared/shared.module.ts

import { Global, HttpModule, Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { GeneratorService, ValidatorService } from 'utils/services';
import { ConfigService } from '@nestjs/config';

const providers = [ValidatorService, GeneratorService];

@Global()
@Module({
  providers,
  imports: [
    HttpModule,
    JwtModule.registerAsync({
      useFactory: (configService: ConfigService) => ({
        privateKey: configService.get('JWT_SECRET_KEY'),
        // signOptions: {
        //   expiresIn: configService.get<number>('JWT_EXPIRATION_TIME'),
        // },
      }),
      inject: [ConfigService],
    }),
  ],
  exports: [...providers, HttpModule, JwtModule],
})
export class SharedModule {}

result-matching ""

    No results matching ""