class WebSocketMockIntegration
Language | Type name |
---|---|
![]() | Amazon.CDK.AwsApigatewayv2Integrations.WebSocketMockIntegration |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2integrations#WebSocketMockIntegration |
![]() | software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketMockIntegration |
![]() | aws_cdk.aws_apigatewayv2_integrations.WebSocketMockIntegration |
![]() | aws-cdk-lib » aws_apigatewayv2_integrations » WebSocketMockIntegration |
Extends
Web
Mock WebSocket Integration.
Example
import { WebSocketMockIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
new apigwv2.WebSocketStage(this, 'mystage', {
webSocketApi,
stageName: 'dev',
autoDeploy: true,
});
webSocketApi.addRoute('sendMessage', {
integration: new WebSocketMockIntegration('DefaultIntegration', {
requestTemplates: { 'application/json': JSON.stringify({ statusCode: 200 }) },
templateSelectionExpression: '\\$default',
}),
returnResponse: true,
});
Initializer
new WebSocketMockIntegration(id: string, props?: WebSocketMockIntegrationProps)
Parameters
- id
string
— id of the underlying integration construct. - props
Web
Socket Mock Integration Props
Methods
Name | Description |
---|---|
bind(options) | Bind this integration to the route. |
bind(options)
public bind(options: WebSocketRouteIntegrationBindOptions): WebSocketRouteIntegrationConfig
Parameters
Returns
Bind this integration to the route.