You should install dependencies first:
$ npm install @alicloud/fun -g
$ npm install
Modify the config.js
file, replace following config with yourself token, encoding aes key, appid:
exports.config = {
token: '<YOUR TOKEN>',
encodingAESkey: '<YOUR ENCODING AES KEY>',
appid: '<YOUR APP ID>'
};
Deploy it to AliCloud API Gateway & Function Compute:
$ fun deploy
URL: GET http://<api group id>-cn-hangzhou.alicloudapi.com/wechat => cn-shanghai/wechat/get
URL: POST http://<api group id>-cn-hangzhou.alicloudapi.com/wechat => cn-shanghai/wechat/post
Set the url in Wechat MP admin console.
Demo:
npm run test
The MIT License