Skip to content

Commit

Permalink
feat(init): choose the internal endpoint when in tencentcloud serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
lou1swu committed Dec 27, 2019
1 parent f93d3e9 commit 472267d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,15 @@ class SDK {

this.extraParams = __extraParams
this.config = __config

const isScf = process.env.TENCENTCLOUD_RUNENV === 'SCF'

const capi = new Capi({
SecretId: __config.secretId,
SecretKey: __config.secretKey,
serviceType: 'scf',
path: '/',
baseHost: 'tencentcloudapi.com',
baseHost: isScf ? 'internal.tencentcloudapi.com' : 'tencentcloudapi.com',
protocol: 'https'
})
this.requestHelper = (data, opts, extra) => {
Expand Down

0 comments on commit 472267d

Please sign in to comment.