I would like to know if i'm getting ConfigService the right way during bootstrap my microservice.
Is there a way to do it using NestFactory.createMicroservice()?
async function bootstrap() {
const app = await NestFactory.create(CoreModule, {
logger: new MyLogger(),
});
const configService: ConfigService = app.get(ConfigService);
app.connectMicroservice({
transport: Transport.TCP,
options: {
port: configService.PORT,
},
});
await app.startAllMicroservicesAsync();
}