Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
dist
node_modules
component
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ env.js
package-lock.json
yarn.lock
CHANGELOG.md
component
20 changes: 10 additions & 10 deletions docs/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ pyramid:

Main param description

| Param | Required/Optional | Default | Description |
| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------------------------------ |
| region | Optional | ap-guangzhou | |
| pyramidProjectName | Required | | Pyramid Projct Name |
| functionName | Optional | | ServerlessCloudFunction Name |
| serviceName | Optional | | API-Gateway service name, default to create a new serivce |
| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service |
| code | Optional | | Default is current working directory |
| [functionConf](#funtionConf-param-description) | Optional | | Function configure |
| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure |
| Param | Required/Optional | Default | Description |
| --------------------------------------------------- | :---------------: | :----------: | :------------------------------------------------------------------- |
| region | Optional | ap-guangzhou | |
| pyramidProjectName | Required | | Pyramid Projct Name |
| functionName | Optional | | ServerlessCloudFunction Name |
| serviceName | Optional | | API-Gateway service name, default to create a new serivce |
| serviceId | Optional | | API-Gateway service id, if it has will use this APII-Gateway service |
| code | Optional | | Default is current working directory |
| [functionConf](#funtionConf-param-description) | Optional | | Function configure |
| [apigatewayConf](#apigatewayConf-param-description) | Optional | | API-Gateway configure |

### funtionConf param description

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
},
"dependencies": {
"@serverless/core": "^1.1.1",
"@serverless/tencent-apigateway": "^2.0.4",
"@serverless/tencent-scf": "^2.0.9",
"@serverless/tencent-apigateway": "^2.1.4",
"@serverless/tencent-scf": "^3.0.0",
"ext": "^1.4.0",
"type": "^2.0.0"
},
Expand Down
7 changes: 5 additions & 2 deletions serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TencentPyramid extends Component {
`PyramidComponent_${random({ length: 6 })}`
inputs.codeUri = ensureString(inputs.code, { isOptional: true }) || process.cwd()
inputs.region = ensureString(inputs.region, { default: 'ap-guangzhou' })
inputs.namespace = ensureString(inputs.namespace, { default: 'default' })
inputs.include = ensureIterable(inputs.include, { default: [], ensureItem: ensureString })
inputs.exclude = ensureIterable(inputs.exclude, { default: [], ensureItem: ensureString })
inputs.apigatewayConf = ensurePlainObject(inputs.apigatewayConf, { default: {} })
Expand Down Expand Up @@ -114,10 +115,12 @@ class TencentPyramid extends Component {
method: 'ANY',
function: {
isIntegratedResponse: true,
functionName: tencentCloudFunctionOutputs.Name
functionName: tencentCloudFunctionOutputs.Name,
functionNamespace: inputs.namespace
}
}
]
],
customDomain: inputs.apigatewayConf.customDomain
}

if (inputs.apigatewayConf && inputs.apigatewayConf.auth) {
Expand Down