You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{
ApiGatewayManagementApiClient,
PostToConnectionCommand,
GetConnectionCommand,}=require("@aws-sdk/client-apigatewaymanagementapi");exports.handler=asyncfunction(event){letconnectionInfo;letconnectionId=event.requestContext.connectionId;constcallbackAPI=newApiGatewayManagementApiClient({apiVersion: "2018-11-29",endpoint:
"https://"+event.requestContext.domainName+"/"+event.requestContext.stage,});try{connectionInfo=awaitcallbackAPI.send(newGetConnectionCommand({ConnectionId: event.requestContext.connectionId,}));}catch(e){console.log(e);}connectionInfo.connectionID=connectionId;awaitcallbackAPI.send(newPostToConnectionCommand({ConnectionId: event.requestContext.connectionId,Data:
"Use the sendmessage route to send a message. Your info:"+JSON.stringify(connectionInfo),}));return{statusCode: 200,};};
The text was updated successfully, but these errors were encountered:
Resources found:
connect handler
disconnect handler
send message handler
default handler
The text was updated successfully, but these errors were encountered: