main.ts 796 B

1234567891011121314151617181920212223242526
  1. import { NestFactory } from '@nestjs/core';
  2. import { MicroserviceOptions, Transport } from '@nestjs/microservices';
  3. import { ConfigService } from '@nestjs/config';
  4. import 'dotenv/config'
  5. import { FisFingerprintModule } from './fis-fingerprint.module';
  6. async function bootstrap() {
  7. const host: string = process.env.HOST as unknown as string
  8. const port: number = process.env.FINGERPRINT_TCP_PORT as unknown as number
  9. const app = await NestFactory.createMicroservice<MicroserviceOptions>(
  10. FisFingerprintModule,
  11. {
  12. transport: Transport.TCP,
  13. options: {
  14. host: host,
  15. port: port,
  16. retryAttempts: 5,
  17. retryDelay: 3000
  18. },
  19. }
  20. );
  21. await app.listen()
  22. console.log(`Fingerprint microsservice is running on ${host}:${port}`);
  23. }
  24. bootstrap();