How to use the @aws-cdk/aws-apigateway.PassthroughBehavior function in @aws-cdk/aws-apigateway

To help you get started, we’ve selected a few @aws-cdk/aws-apigateway 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 fogfish / aws-cdk-pure / hoc / src / staticweb.ts View on Github external
"method.response.header.Content-Length": "integration.response.header.Content-Length",
            "method.response.header.Content-Type": "integration.response.header.Content-Type",
          },
          selectionPattern: '2\\d{2}',
          statusCode: '200',
        },
        {
          selectionPattern: '404',
          statusCode: '404',
        },
        {
          selectionPattern: '4\\d{2}',
          statusCode: '403',
        }
      ],
      passthroughBehavior: api.PassthroughBehavior.WHEN_NO_TEMPLATES,
      requestParameters: {
        "integration.request.path.key": "method.request.path.key"
      },
    },
    path,
    service: 's3',
  })
  const SiteContent = content([origin.bucketName, root.origin, '{key}'].join('/'))
github fogfish / aws-cdk-pure / hoc / src / gateway.ts View on Github external
const head = `'${props.header ? props.header.join(',') : 'Content-Type,Authorization,Accept,Origin'}'`
  const origin = `'${props.origin || '*'}'`
  const mock = new api.MockIntegration({
    integrationResponses: [
      {
        responseParameters: {
          "method.response.header.Access-Control-Allow-Headers": head,
          "method.response.header.Access-Control-Allow-Methods": mthd,
          "method.response.header.Access-Control-Allow-Origin": origin,
          "method.response.header.Access-Control-Max-Age": "'600'",
        },
        selectionPattern: '\\d{3}',
        statusCode: '200',
      },
    ],
    passthroughBehavior: api.PassthroughBehavior.WHEN_NO_MATCH,
    requestTemplates: {
      "application/json": "{\"statusCode\": 200}"
    },
  })
  const method = {
    methodResponses: [
      {
        responseModels: {
          "application/json": new api.EmptyModel(),
        },
        responseParameters: {
          "method.response.header.Access-Control-Allow-Headers": true,
          "method.response.header.Access-Control-Allow-Methods": true,
          "method.response.header.Access-Control-Allow-Origin": true,
          "method.response.header.Access-Control-Max-Age": true,
        },