WebSocketRouteOptions Struct
Options used to add route to the API.
Example
ts
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
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
authorizerIWebSocketRouteAuthorizerauthorizerIWebSocketRouteAuthorizerauthorizerIWebSocketRouteAuthorizerAuthorizerIWebSocketRouteAuthorizerAuthorizerIWebSocketRouteAuthorizer= No Authorizer#The authorize to this route.
You can only set authorizer to a $connect route.
integrationWebSocketRouteIntegrationintegrationWebSocketRouteIntegrationintegrationWebSocketRouteIntegrationIntegrationWebSocketRouteIntegrationIntegrationWebSocketRouteIntegrationrequired#The integration to be configured on this route.
returnResponsebooleanreturn_responseboolreturnResponseBooleanReturnResponseboolReturnResponse*bool= false#Should the route send a response to the client.