How to use the tencent-component-toolkit.Apigw function in tencent-component-toolkit

To help you get started, we’ve selected a few tencent-component-toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless-components / tencent-laravel / src / serverless.js View on Github external
async remove() {
    console.log(`Removing ${CONFIGS.compFullname} App...`)

    const { state } = this
    const { regionList = [] } = state

    const credentials = this.getCredentials()

    const removeHandlers = []
    for (let i = 0; i < regionList.length; i++) {
      const curRegion = regionList[i]
      const curState = state[curRegion]
      const scf = new Scf(credentials, curRegion)
      const apigw = new Apigw(credentials, curRegion)
      const handler = async () => {
        await scf.remove({
          functionName: curState.functionName,
          namespace: curState.namespace
        })
        // if disable apigw, no need to remove
        if (state.apigwDisabled !== true) {
          await apigw.remove({
            created: curState.created,
            environment: curState.environment,
            serviceId: curState.serviceId,
            apiList: curState.apiList,
            customDomains: curState.customDomains
          })
        }
      }
github serverless-components / tencent-laravel / src / serverless.js View on Github external
const apigwDeployer = async () => {
        const apigw = new Apigw(credentials, curRegion)

        const oldState = this.state[curRegion] || {}
        const apigwInputs = {
          ...inputs,
          oldState: {
            apiList: oldState.apiList || [],
            customDomains: oldState.customDomains || []
          }
        }
        // different region deployment has different service id
        apigwInputs.serviceId = getServiceId(this, curRegion)
        const apigwOutput = await apigw.deploy(deepClone(apigwInputs))
        outputs[curRegion] = {
          serviceId: apigwOutput.serviceId,
          subDomain: apigwOutput.subDomain,
          environment: apigwOutput.environment,