🛰 Lightweight service discovery
🚧 Work in progress
The place where old-school Service Registry
meets crypto.
Installation
Install from NPM:
$ npm i micro-discovery -S
For yarn
fans:
$ yarn add micro-discovery
Examples
The following examples are designed as simple Micro
handlers. If you aren't familar with Micro
- you definitely must try this goodness.
This basic service registry includes node config, secret keys, and an access control list.
const registry = moduleexports =
Basic weather microservice
const discovery = const authorize config locate = moduleexports = async { // Authorize service call. // Fully synchronous, you even don't need to interact with a registry. // Retrieve service configuration const configuration = await console // Service info will contains service endpoint, and temporary token. const serviceInfo = await console // fetch(serviceInfo.endpoint, { // headers: { Authorization: `Bearer ${serviceInfo.token}`} // }) return weather: '☀️' }