@aws-cdk_aws-apigatewayv2-alpha.WebSocketRouteOptions

interface WebSocketRouteOptions ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.WebSocketRouteOptions
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#WebSocketRouteOptions
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.WebSocketRouteOptions
Pythonaws_cdk.aws_apigatewayv2_alpha.WebSocketRouteOptions
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป WebSocketRouteOptions

Options used to add route to the API.

Example

import { WebSocketLambdaIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
new apigwv2.WebSocketStage(this, 'mystage', {
  webSocketApi,
  stageName: 'dev',
  autoDeploy: true,
});

declare const messageHandler: lambda.Function;
webSocketApi.addRoute('sendmessage', {
  integration: new WebSocketLambdaIntegration('SendMessageIntegration', messageHandler),
});

Properties

NameTypeDescription
integration๐Ÿ”นWebSocketRouteIntegrationThe integration to be configured on this route.
authorizer?๐Ÿ”นIWebSocketRouteAuthorizerThe authorize to this route.
returnResponse?๐Ÿ”นbooleanShould the route send a response to the client.

integration๐Ÿ”น

Type: WebSocketRouteIntegration

The integration to be configured on this route.


authorizer?๐Ÿ”น

Type: IWebSocketRouteAuthorizer (optional, default: No Authorizer)

The authorize to this route.

You can only set authorizer to a $connect route.


returnResponse?๐Ÿ”น

Type: boolean (optional, default: false)

Should the route send a response to the client.