How to use the @aws-cdk/aws-apigateway.EmptyModel 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 / gateway.ts View on Github external
"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,
        },
        statusCode: '200',
      },
    ],
  }
  endpoint.addMethod('OPTIONS', mock, method)
  return endpoint
}