Skip to content

Commit ef3d53c

Browse files
committed
feat: support apigw base64 encode
1 parent 2992b51 commit ef3d53c

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

docs/configure.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ inputs:
4444
apigatewayConf: # api网关配置
4545
isDisabled: false # 是否禁用自动创建 API 网关功能
4646
enableCORS: true # 允许跨域
47+
isBase64Encoded: false # 是否开启 base64 编码
4748
customDomains: # 自定义域名绑定
4849
- domain: abc.com # 待绑定的自定义的域名
4950
certificateId: abcdefg # 待绑定自定义域名的证书唯一 ID
@@ -174,16 +175,17 @@ inputs:
174175

175176
### API 网关配置
176177

177-
| 参数名称 | 是否必选 | 类型 | 默认值 | 描述 |
178-
| -------------- | :------: | :------- | :--------- | :--------------------------------------------------------------------------------- |
179-
| protocols | 否 | String[] | `['http']` | 前端请求的类型,如 http,https,http 与 https |
180-
| environment | 否 | String | `release` | 发布环境. 目前支持三种发布环境: test(测试), prepub(预发布) 与 release(发布). |
181-
| usagePlan | 否 | | | 使用计划配置, 参考 [使用计划](#使用计划) |
182-
| auth | 否 | | | API 密钥配置, 参考 [API 密钥](#API-密钥配置) |
183-
| customDomain | 否 | Object[] | | 自定义 API 域名配置, 参考 [自定义域名](#自定义域名) |
184-
| enableCORS | 否 | Boolean | `false` | 开启跨域。默认值为否。 |
185-
| serviceTimeout | 否 | Number | `15` | Api 超时时间,单位: 秒 |
186-
| isDisabled | 否 | Boolean | `false` | 关闭自动创建 API 网关功能。默认值为否,即默认自动创建 API 网关。 |
178+
| 参数名称 | 是否必选 | 类型 | 默认值 | 描述 |
179+
| --------------- | :------: | :------- | :--------- | :--------------------------------------------------------------------------------- |
180+
| protocols | 否 | String[] | `['http']` | 前端请求的类型,如 http,https,http 与 https |
181+
| environment | 否 | String | `release` | 发布环境. 目前支持三种发布环境: test(测试), prepub(预发布) 与 release(发布). |
182+
| usagePlan | 否 | | | 使用计划配置, 参考 [使用计划](#使用计划) |
183+
| auth | 否 | | | API 密钥配置, 参考 [API 密钥](#API-密钥配置) |
184+
| customDomain | 否 | Object[] | | 自定义 API 域名配置, 参考 [自定义域名](#自定义域名) |
185+
| enableCORS | 否 | Boolean | `false` | 开启跨域。默认值为否。 |
186+
| serviceTimeout | 否 | Number | `15` | Api 超时时间,单位: 秒 |
187+
| isDisabled | 否 | Boolean | `false` | 关闭自动创建 API 网关功能。默认值为否,即默认自动创建 API 网关。 |
188+
| isBase64Encoded | 否 | Boolean | `false` | 是否开启 Base64 编码,如果需要文件上传,请配置为 `true` |
187189

188190
##### 使用计划
189191

serverless.component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: nuxtjs
2-
version: 0.1.8
2+
version: 0.2.0
33
author: 'Tencent Cloud, Inc.'
44
org: 'Tencent Cloud, Inc.'
55
description: Deploy a serverless Nuxt.js application onto Tencent SCF and API Gateway.

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": {
33
"adm-zip": "^0.4.16",
44
"download": "^8.0.0",
5-
"tencent-component-toolkit": "^1.20.5",
5+
"tencent-component-toolkit": "^1.20.10",
66
"type": "^2.1.0"
77
}
88
}

src/utils.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ const prepareInputs = async (instance, credentials, inputs = {}) => {
426426
serviceTimeout: tempApigwConf.serviceTimeout,
427427
method: 'ANY',
428428
apiName: tempApigwConf.apiName || 'index',
429+
isBase64Encoded: tempApigwConf.isBase64Encoded,
430+
isBase64Trigger: tempApigwConf.isBase64Trigger,
431+
base64EncodedTriggerRules: tempApigwConf.base64EncodedTriggerRules,
429432
function: {
430433
isIntegratedResponse: true,
431434
functionName: functionConf.name,

0 commit comments

Comments
 (0)