import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
import { join } from 'path';

async function bootstrap() {
  const app = await NestFactory.createMicroservice<MicroserviceOptions>(AppModule, {
    transport: Transport.GRPC,
    options: {
      package: 'activity_logger',
      protoPath: join(__dirname, '../proto/activity_logger.proto'),
      url: '0.0.0.0:5012',
    },
  });
  await app.listen();
  console.log('activity-logger running on gRPC :5012');
}
bootstrap();
