egg-aliyun-fc
v1.0.3
Published
aliyun fc for egg
Downloads
3
Readme
egg-aliyun-fc
Install
$ npm i egg-aliyun-fc --save
Usage
// {app_root}/config/plugin.js
exports.aliyunFc = {
enable: true,
package: 'egg-aliyun-fc',
};
Configuration
// {app_root}/config/config.default.js
exports.aliyunFc = {
client: {
accountId: '<>',
accessKeyID: '<>',
accessKeySecret: '<>',
region: '<>'
}
};
see config/config.default.js for more detail.
Example
export default class queryService extends Service {
async test() {
const fc = this.ctx.fc;
const functioncode = await fc.getFunctionCode('anymock', 'handler')// 这里的详细api请参见 http://doxmate.cool/aliyun/fc-nodejs-sdk/api.html#client__createFunction
const functioncode1 = await fc.createFunction('iat_anymock', {
functionName: 'xxx',
handler: 'main.handler',
runtime: 'nodejs8',
memorySize: 100,
timeout: 5,
code: `
function(event, context, callback) {
console.log('hello world');
callback(null, 'hello world');
}
`
}); // 增加了string形式的create 和update
}
}
Questions & Suggestions
Please open an issue here.