Giter Site home page Giter Site logo

eureka-nodejs-client's Introduction

eureka-nodejs-client

Eureka server version 1.9.8

Example demo:

npm install eureka-nodejs-client --save

let eureka = require('eureka-nodejs-client')({
    eureka: {
        serviceUrl: ['http://10.160.1.11:8761'],
        pollIntervalSeconds: 10,
        registerWithEureka: false,   //是否注册当前注册
    },
    //最简单实例配置,更多配置参考默认配置文件 
    instance:{
        app: 'test-instance',  //当前服务名
        ipAddr: '10.21.0.31',  //当前服务IPv4
        port: 8761             //当前服务端口
    }
}, 'info')

//服务启动事件执行
eureka.start()

//删除服务,服务停止事件执行
eureka.delete()

//默认简单使用随机方式获取实例IP与端口,应用用来调用服务
eureka.instance('test-instance').then(rs=>{
    console.log(rs)   // { idAddr: '10.21.0.31', port: 8761 }    
})

//健康检查express路由
eureka.eurekaExpressRouter()


//健康检查express路由
eureka.eurekaKoaRouter()

eureka-nodejs-client's People

Contributors

zingson avatar

Stargazers

 avatar

Watchers

 avatar

eureka-nodejs-client's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.