Library for interact in the microservice with the Control-tower api-gateway (register, do request to other microservices, etc)
npm install ct-register-microservice-nodeLibrary to register and integrate microservice in the Control Tower API gateway. This library implement the /info and /ping endpoints that Control Tower uses to obtain info of the registered microservices and check live.
Supports Koa 2.x and 1.x frameworks.
`````
npm install --save ct-register-microservice-node
In the listen callback of your Koa application, add the following code snippet:
`javascript``
const promise = require('ct-register-microservice-node').register({
info: info,
swagger: swagger,
logger: logger,
app: app,
mode: 'auto',
framework: ctRegisterMicroservice.KOA2,
token: '
ctUrl: '
});
p.then(function() {}, function(err) {
logger.error(err);
process.exit(1);
});