Skip to content

Commit a58b258

Browse files
authored
Merge pull request #1 from yugasun/fix/apigw-namespace
fix: apigw namespace
2 parents 97da2f9 + 11ef379 commit a58b258

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
coverage
22
dist
33
node_modules
4+
component

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ env.js
2121
package-lock.json
2222
yarn.lock
2323
CHANGELOG.md
24+
component

docs/configure.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ pyramid:
4343
4444
Main param description
4545
46-
| Param | Required/Optional | Default | Description |
47-
| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------------------------------ |
48-
| region | Optional | ap-guangzhou | |
49-
| pyramidProjectName | Required | | Pyramid Projct Name |
50-
| functionName | Optional | | ServerlessCloudFunction Name |
51-
| serviceName | Optional | | API-Gateway service name, default to create a new serivce |
52-
| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service |
53-
| code | Optional | | Default is current working directory |
54-
| [functionConf](#funtionConf-param-description) | Optional | | Function configure |
55-
| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure |
46+
| Param | Required/Optional | Default | Description |
47+
| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------- |
48+
| region | Optional | ap-guangzhou | |
49+
| pyramidProjectName | Required | | Pyramid Projct Name |
50+
| functionName | Optional | | ServerlessCloudFunction Name |
51+
| serviceName | Optional | | API-Gateway service name, default to create a new serivce |
52+
| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service |
53+
| code | Optional | | Default is current working directory |
54+
| [functionConf](#funtionConf-param-description) | Optional | | Function configure |
55+
| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure |
5656
5757
### funtionConf param description
5858

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
},
4848
"dependencies": {
4949
"@serverless/core": "^1.1.1",
50-
"@serverless/tencent-apigateway": "^2.0.4",
51-
"@serverless/tencent-scf": "^2.0.9",
50+
"@serverless/tencent-apigateway": "^2.1.4",
51+
"@serverless/tencent-scf": "^3.0.0",
5252
"ext": "^1.4.0",
5353
"type": "^2.0.0"
5454
},

serverless.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TencentPyramid extends Component {
4646
`PyramidComponent_${random({ length: 6 })}`
4747
inputs.codeUri = ensureString(inputs.code, { isOptional: true }) || process.cwd()
4848
inputs.region = ensureString(inputs.region, { default: 'ap-guangzhou' })
49+
inputs.namespace = ensureString(inputs.namespace, { default: 'default' })
4950
inputs.include = ensureIterable(inputs.include, { default: [], ensureItem: ensureString })
5051
inputs.exclude = ensureIterable(inputs.exclude, { default: [], ensureItem: ensureString })
5152
inputs.apigatewayConf = ensurePlainObject(inputs.apigatewayConf, { default: {} })
@@ -114,10 +115,12 @@ class TencentPyramid extends Component {
114115
method: 'ANY',
115116
function: {
116117
isIntegratedResponse: true,
117-
functionName: tencentCloudFunctionOutputs.Name
118+
functionName: tencentCloudFunctionOutputs.Name,
119+
functionNamespace: inputs.namespace
118120
}
119121
}
120-
]
122+
],
123+
customDomain: inputs.apigatewayConf.customDomain
121124
}
122125

123126
if (inputs.apigatewayConf && inputs.apigatewayConf.auth) {

0 commit comments

Comments
 (0)