I would like to understand the difference between forRoot and forFeature in nest js dynamic modules.
I also would like to understand this difference in the case of the TypeOrm dynamic module used with nestjs.
From Nest.js Discord,
forRoot / forRootAsync: configure a module one time. This is either for a global service, or a re-used configuration internallyforFeature / forFeatureAsync: make use of the configuration from forRoot/forRootAsync for a specific provider. This usually creates an injection token.register / registerAsync: a module that can be registered multiple times with different configurations each time.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With