1.新建一个服务流如图所示#
2.nodejs配置 #
完整的节点代码
module.exports = async function(payload, node, query, context, global) {
const Core = require('@alicloud/pop-core');
var client = new Core({
accessKeyId: 'LTAI4FyhxT4Z4WQQvSyfFAKJ',
accessKeySecret: 'jdjP6MDjZkQztyjDMSyhoitZ1dxR8d',
endpoint: 'https://iot.cn-shanghai.aliyuncs.com',
apiVersion: '2018-01-20'
});
var params = {
"RegionId": "cn-shanghai",
"CurrentPage": 1,
"PageSize": 10
}
var requestOption = {
method: 'POST'
};
var response="";
await client.request('QueryProductList', params, requestOption).then((result) => {
console.log(JSON.stringify(result));
response = result;
}, (ex) => {
console.log(ex);
})
return response;
}
保存部署测试