Skip to content

Library to help in the register task of the microservices in Control Tower

License

Notifications You must be signed in to change notification settings

control-tower/ct-register-microservice-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control Tower microservice utility for Nodejs applications

Library 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.

Install

npm install --save ct-register-microservice-node

Use in microservice

In the listen callback of your Koa application, add the following code snippet:

    const promise = require('ct-register-microservice-node').register({
        info: info,
        swagger: swagger,
        logger: logger, 
        app: app,
        mode: 'auto',
        framework: ctRegisterMicroservice.KOA2,
        token: '<your control tower token>',
        ctUrl: '<your control tower instance URL>'
    });
    p.then(function() {}, function(err) {
        logger.error(err);
        process.exit(1);
    });

TODO

  • Properly document config options

About

Library to help in the register task of the microservices in Control Tower

Resources

License

Stars

Watchers

Forks

Packages

No packages published