microservice-info
v1.1.2
Published
Returns info relevant to use a service in armand1m/microservices project.
Downloads
12
Readme
microservice-info
This module returns the necessary info from the server to connect a Node.js microservice into the armand1m/microservices environment.
Install
$ npm install --save microservice-info
Usage
const Info = require('microservice-info');
Info.host();
//returns host name=> 'server-name'
Info.ip();
// returns host ip => '127.0.0.1'
Info.consul();
// returns consul configuration and description for clients to connect:
/*
{
configuration: {
host: process.env.CONSUL_HOST,
port: process.env.CONSUL_PORT,
promisify: true
},
description: {
name: `${Info.name}:${Info.host}`,
address: Info.host,
port: Info.port,
tags: Info.tags,
check: Info.check
}
};
*/
API
microserviceInfo(input, [options])
input
Type: string
Lorem ipsum.
options
foo
Type: boolean
Default: false
Lorem ipsum.
License
MIT © Armando Magalhães