@everymundo/em-eureka

1.11.1 • Public • Published

@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});
  })

Readme

Keywords

none

Package Sidebar

Install

npm i @everymundo/em-eureka

Weekly Downloads

1

Version

1.11.1

License

MIT

Unpacked Size

83.4 kB

Total Files

32

Last publish

Collaborators

  • a11y-dev
  • jsalvadorpp
  • lindolo25
  • double2-us
  • ceciliagalarza
  • carla-villegas
  • eblez
  • mjremedios1985
  • mtmorell88
  • a11y_automation2
  • ramses83
  • raydel
  • alex-orga
  • estebanpablo89
  • yartiles
  • jonmorazav
  • everymundo-admin
  • ballester
  • danielsan
  • halain
  • avivero93
  • anahiem
  • herlin
  • karinfdez
  • erlin
  • front10devs
  • hdelcastillo
  • dcuevacem
  • rodneyem
  • ortega.dc98
  • pedroleon917
  • kaylingw
  • lazjramos
  • daniuska-em