npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

duiba-eureka-node-client

2.0.4 • Public • Published

Eureka

NodeJS接入Eureka,基于eureka-js-client封装

Use

// package.json
{
  "dependencies": {
    "duiba-node-docker": "git+ssh://git@gitlab2.dui88.com:frontend/duiba-eureka-js-client.git#2.0.3"
  }
}
const EurekaClient = require('duiba-eureka-js-client');
 
EurekaClient({
  port: 3000, // 端口号
  appName: 'eureka-test', // 应用名称
  services: ['TUIA-ACTIVITY-WEB', 'TUIA-ADVERT-CENTER', 'TUIA-ADVERT-MANAGER'] // 需要调用的服务名称
}).then(eureka => {
  // eureka注册完成回调,返回eureka实例
})
### De-register with Eureka & stop application heartbeats
``` js
global.Eureka.stop();

Get Instances By App ID

const host = global.Eureka.getHost('YOURSERVICE');

Keywords

install

npm i duiba-eureka-node-client

Downloadsweekly downloads

2

version

2.0.4

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability