egg-plugin-acm
v1.1.5
Published
egg plugin acm
Downloads
9
Maintainers
Readme
egg-hello
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.