Dear, I have a microservice (a) or a small API that requires you to use the services of another API (b), which consists of about 4 ENDPOINT (Address, municipality, province, region, etc).
I am currently using a NODE module called request:
const request = require('request');
but I can only call an endpoint:
request(
'http://localhost:3000/v1/api/endpoint/${parametro_1}/?
parametroQuery=${parametroQuery}',
{ json: true }, (err, res, body) => {
if (err) { return console.log(err); }
if (body.data) {
body.data.forEach((o) => {
})
}
}
);
With the data I get, specifically an id that comes from that endpoint, I must call another service, and so on about 4 services in succession.
How do you suggest doing it to make it more optimal and efficient?