1.1.2 • Published 7 years ago

microservice-info v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

microservice-info Build Status Coverage Status

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

1.1.2

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago