egg plugin acm
npm install egg-plugin-acm[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]
[npm-image]: https://img.shields.io/npm/v/egg-hello.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-hello
[travis-image]: https://img.shields.io/travis/eggjs/egg-hello.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-hello
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-hello.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-hello?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-hello.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-hello
[snyk-image]: https://snyk.io/test/npm/egg-hello/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-hello
[download-image]: https://img.shields.io/npm/dm/egg-hello.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-hello
``bash`
$ npm i egg-plugin-acm --save
`js`
// {app_root}/config/plugin.js
exports.eggPluginAcm = {
enable: true,
package: 'egg-plugin-acm',
};
`js
// {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: '',
},
],
};
`
`js
// 在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.
Please open an issue here.