@everymundo/em-eureka

wrapper around eureka-js-client for everymundo microservice apps

Stats

StarsIssuesVersionUpdatedCreatedSize
@everymundo/em-eureka
1.10.75 months ago4 years agoMinified + gzip package size for @everymundo/em-eureka in KB

Readme

@everymundo/em-eureka

Description

This is a tool to help integrate nodejs applications with the everymundo microservices infrastructure by allowing nodejs apps to connect to Netflix Eureka servers.

Installation

npm install @everymundo/em-eureka

Usage

const {EmEureka:{createClient}} = require('@everymundo/em-eureka');

// To connect to eureka and put this app available to other apps to use
const eurekaCli = createClient({ app: 'myAppName', port: 3001 });

// Then, after the previous line
// to use apps already available on eureka
const otherApp = eurekaCli.service('otherApp', {headers: {'x-api-key'}});

otherApp.get('/method?param1=value1&param2=value')
  .then(({body}) => {
    console.log({body});
  })

otherApp.post('/something?'+Math.random(),{timeout:250, data:{something:'else'}})
  .then((res) => {
    const {body, status, headers} = res
    console.log({body, status, headers});
  })

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.