From 311c47b84d5dfce7d90d8c46c07e9c66b8706917 Mon Sep 17 00:00:00 2001 From: Yuga Sun Date: Mon, 26 Oct 2020 10:21:36 +0800 Subject: [PATCH] fix: handler config and outputs format (#5) * fix: outputs format * fix: handler config --- serverless.component.yml | 2 +- src/config.js | 2 +- src/serverless.js | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/serverless.component.yml b/serverless.component.yml index 8dc0c06..ab73b9c 100644 --- a/serverless.component.yml +++ b/serverless.component.yml @@ -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. diff --git a/src/config.js b/src/config.js index da8fccb..33e7939 100644 --- a/src/config.js +++ b/src/config.js @@ -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', diff --git a/src/serverless.js b/src/serverless.js index d01b025..a673a6a 100644 --- a/src/serverless.js +++ b/src/serverless.js @@ -206,9 +206,6 @@ 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 @@ -216,10 +213,10 @@ class ServerlessComponent extends Component { 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]