I'm creating a custom transport strategy that relies on other services. Is it possible to inject the strategy in the bootstrap function?
class MyTransportStrategy extends Server implements CustomTransportStrategy {
constructor(private service: SomeService) {}
}
...
async function bootstrap() {
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
AppModule,
{
strategy: new MyTransportStrategy(?), // <- Inject instead of construct
},
);
await app.listen();
}