class HttpRouteKey
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGatewayv2.HttpRouteKey |
Java | software.amazon.awscdk.services.apigatewayv2.HttpRouteKey |
Python | aws_cdk.aws_apigatewayv2.HttpRouteKey |
TypeScript (source) | @aws-cdk/aws-apigatewayv2 » HttpRouteKey |
HTTP route in APIGateway is a combination of the HTTP method and the path component.
This class models that combination.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apigatewayv2 from '@aws-cdk/aws-apigatewayv2';
const httpRouteKey = apigatewayv2.HttpRouteKey.with('path', /* all optional props */ apigatewayv2.HttpMethod.ANY);
Properties
Name | Type | Description |
---|---|---|
key | string | The key to the RouteKey as recognized by APIGateway. |
method | Http | The method of the route. |
path? | string | The path part of this RouteKey. |
static DEFAULT | Http | The catch-all route of the API, i.e., when no other routes match. |
key
Type:
string
The key to the RouteKey as recognized by APIGateway.
method
Type:
Http
The method of the route.
path?
Type:
string
(optional)
The path part of this RouteKey.
Returns undefined
when RouteKey.DEFAULT
is used.
static DEFAULT
Type:
Http
The catch-all route of the API, i.e., when no other routes match.
Methods
Name | Description |
---|---|
static with(path, method?) | Create a route key with the combination of the path and the method. |
static with(path, method?)
public static with(path: string, method?: HttpMethod): HttpRouteKey
Parameters
- path
string
- method
Http
— default is 'ANY'.Method
Returns
Create a route key with the combination of the path and the method.