1.2.1 • Published 6 years ago
egg-aliyun-openapi v1.2.1
egg-aliyun-openai
eggjs plugin for invoke aliyun openapi, wrapper of OpenAPI POP core SDK for Node.js
Functionality
- vod
Install
$ npm i egg-aliyun-openapi --saveUsage
- Enable it on plugin configuration:
// {app_root}/config/plugin.[t|j]s
exports.aliyunOpenApi = {
enable: true,
package: "egg-aliyun-openapi"
};- Configure the
access key,access secret, and themount paths:
// {app_root}/config/config.default.[t|j]s
exports.aliyunOpenApi = {
key: "your access key id",
secret: "your secret access key",
regionId: 'cn-shanghai',
apiVersion: '2017-03-21',
mount: {
vod: '/aliyun-openapi/vod'
}
};see config/config.default.ts for more detail.
- You can call it from client side now:
const res = await app
.httpRequest()
.get('/aliyun-openapi/vod?action=GetVideoPlayAuth&videoId=1234')
.expect(200)
assert.deepStrictEqual(res.body.PlayAuth, 'sstyYuew678999ew90000000xtt7TYUh')Questions & Suggestions
Please open an issue here.
License
Test
npm run test-localRelease Notes:
- 1.0.0: proxy aliyun vod product
- 1.1.0: proxy ali green
- 1.2.0: Allow pass PlayConfig to vod