Skip to content

Commit

Permalink
fix: handler config and outputs format (#5)
Browse files Browse the repository at this point in the history
* fix: outputs format

* fix: handler config
  • Loading branch information
yugasun authored Oct 26, 2020
1 parent 846c6a9 commit 311c47b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion serverless.component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: websocket
version: 0.3.0
version: 0.3.1
author: Tencent Cloud, Inc.
org: Tencent Cloud, Inc.
description: Deploys websocket service on Tencent Cloud.
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const CONFIGS = {
compName: 'websocket',
compFullname: 'Websocket',
defaultEntryFile: 'sls.js',
handler: 'handler.socket',
handler: 'handler.handler',
region: 'ap-guangzhou',
runtime: 'Nodejs10.15',
namespace: 'default',
Expand Down
7 changes: 2 additions & 5 deletions src/serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,17 @@ class ServerlessComponent extends Component {
const [faasOutputs, apigwOutputs = {}] = await Promise.all(deployTasks)
const { wsBackUrl } = apigwOutputs[regionList[0]]

this.state.wsBackUrl = wsBackUrl
outputs.wsBackUrl = wsBackUrl

await this.updateFaas(credentials, faasConfig, regionList, wsBackUrl)

// optimize outputs for one region
if (regionList.length === 1) {
const [oneRegion] = regionList
outputs.region = oneRegion
outputs['apigw'] = apigwOutputs[oneRegion]
outputs['scf'] = faasOutputs[oneRegion]
outputs['faas'] = faasOutputs[oneRegion]
} else {
outputs['apigw'] = apigwOutputs
outputs['scf'] = faasOutputs
outputs['faas'] = faasOutputs
}

this.state.region = regionList[0]
Expand Down

0 comments on commit 311c47b

Please sign in to comment.