@aws-cdk_aws-apigatewayv2-alpha.HttpRouteKey

class HttpRouteKey ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.HttpRouteKey
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#HttpRouteKey
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.HttpRouteKey
Pythonaws_cdk.aws_apigatewayv2_alpha.HttpRouteKey
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป 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_alpha from '@aws-cdk/aws-apigatewayv2-alpha';
const httpRouteKey = apigatewayv2_alpha.HttpRouteKey.with('path', /* all optional props */ apigatewayv2_alpha.HttpMethod.ANY);

Properties

NameTypeDescription
key๐Ÿ”นstringThe key to the RouteKey as recognized by APIGateway.
method๐Ÿ”นHttpMethodThe method of the route.
path?๐Ÿ”นstringThe path part of this RouteKey.
static DEFAULT๐Ÿ”นHttpRouteKeyThe 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: HttpMethod

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: HttpRouteKey

The catch-all route of the API, i.e., when no other routes match.

Methods

NameDescription
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 HttpMethod โ€” default is 'ANY'.

Returns

  • HttpRouteKey

Create a route key with the combination of the path and the method.