egg-plugin-acm

1.1.5 • Public • Published

egg-hello

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

Install

$ npm i egg-plugin-acm --save

Usage

// {app_root}/config/plugin.js
exports.eggPluginAcm = {
  enable: true,
  package: 'egg-plugin-acm',
};

Configuration

// {app_root}/config/config.default.js
exports.acm = {
  endpoint: '',
  namespace: '',
  accessKey: '',
  secretKey: '',
  requestTimeout: 6000,
  group: '',
  dataId: '',
};

// or
exports.acm = {
  endpoint: '',
  namespace: '',
  accessKey: '',
  secretKey: '',
  requestTimeout: 6000,
  clients: [
    {
      key: 'acm1',
      group: '',
      dataId: '',
    },
    {
      key: 'acm2',
      group: '',
      dataId: '',
    },
  ],
};

Controller

// 在application中可以这样调用
ctx.app.acm.getAcm(key1, key2 ...);

// or
ctx.app.acm.getAcm([key1, key2 ...]);

// or 如果配置多个使用get获取
ctx.app.acm.acm1.getAcm(key1, key2 ...);

// or
ctx.app.acm.acm2.getAcm([key1, key2 ...]);

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

Example

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-plugin-acm

Weekly Downloads

0

Version

1.1.5

License

ISC

Unpacked Size

9.45 kB

Total Files

9

Last publish

Collaborators

  • lixiang920531