class Cors
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGateway.Cors |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#Cors |
Java | software.amazon.awscdk.services.apigateway.Cors |
Python | aws_cdk.aws_apigateway.Cors |
TypeScript (source) | aws-cdk-lib » aws_apigateway » Cors |
Example
new apigateway.RestApi(this, 'api', {
defaultCorsPreflightOptions: {
allowOrigins: apigateway.Cors.ALL_ORIGINS,
allowMethods: apigateway.Cors.ALL_METHODS // this is also the default
}
})
Properties
Name | Type | Description |
---|---|---|
static ALL_METHODS | string[] | All HTTP methods. |
static ALL_ORIGINS | string[] | All origins. |
static DEFAULT_HEADERS | string[] | The set of default headers allowed for CORS and useful for API Gateway. |
static ALL_METHODS
Type:
string[]
All HTTP methods.
static ALL_ORIGINS
Type:
string[]
All origins.
static DEFAULT_HEADERS
Type:
string[]
The set of default headers allowed for CORS and useful for API Gateway.