1.0.1 • Published 5 years ago

egg-multi-grpc v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-multi-grpc

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-multi-grpc --save

Usage

// {app_root}/config/plugin.js
exports.multiGrpc = {
  enable: true,
  package: 'egg-multi-grpc',
};

Configuration

// {app_root}/config/config.default.js
exports.multiGrpc = {
  grpc: {
    dir: 'app/proto/grpc',
    property: 'grpc',
    loadOpts: {
      convertFieldsToCamelCase: true,
    },
    endpoint: 'localhost:50051',
    timeout: 5000,
  },
  grpch: {
    dir: 'app/proto/grpch',
    property: 'grpch',
    loadOpts: {
      convertFieldsToCamelCase: true,
    },
    endpoint: '192.168.1.117:50051',
    timeout: 5000,
  },
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT