With nestjs framework in mind, I have a couple of services exposed as API. Each service has its own module and specific httpmodule config.
ServiceA needs to make a call to ServiceB. In this case I have two options: 1 - Perform an http request. 2 - Consume serviceB within service A.
For option 1 there is a problem. ServiceA has its own HTTPModule config and therefore to perform an http request I need to override HttpModule configurations. Also, it puts an unnecessary load on my service sending http requests.
Option 2 seems to have an issue where ServiceA HttpModule configurations are being used for ServiceB.
Question: IS there a way to consume ServiceB in ServiceA but maintain the module context integrity of ServiceB?
For clarity here is the structure:
-src
--serviceA
-- serviceA.module.ts
-- serviceA.service.ts
--serviceB
-- serviceB.module.ts
-- serviceB.service.ts
Thanks