npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

@taccisum/egg-eureka

1.0.2 • Public • Published

egg-eureka

NPM version npm download

egg-eureka插件基于eureka-js-client v4.4.2,帮助你在eggjs下快速将应用注册到eureka server。

安装

通过npm仓库安装

$ npm i @taccisum/egg-eureka --save

本地安装

$ git clone http://gitlab.deepexi.top/taccisum/egg-eureka
cd ./egg-eureka
$ npm link
cd ${your_project_root}
$ npm link @taccisum/egg-eureka

使用

// {app_root}/config/plugin.js
exports.eureka = {
  enable: true,
  package: '@taccisum/egg-eureka',
};

配置

// {app_root}/config/config.default.js
exports.eureka = {
  client: {
    instance: {
      app: 'foo-service',
      ipAddr: '127.0.0.1',
      vipAddress: 'deepexi.foo',
      port: 8080,
    },
    server: {
      host: '192.168.0.239',
      port: 8761,
    },
    // auth: {
    //   user: 'admin',
    //   password: 'deepexi',
    // },
  },
};

以上是最小配置,更多配置可以参考eureka-js-client;

使用示例

const instances = app.eureka.getInstancesByAppId('foo-service');
// do something via instances info

问题和建议

empty now.

License

MIT

install

npm i @taccisum/egg-eureka

Downloadsweekly downloads

1

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability