.
├── fetchMessages <-- Source code for get messages from DB
├── onConnect <-- Source code onConnect
├── sendMessage <-- Source code sendMessage
└── template.yaml <-- SAM template for Lambda Functions and DDB
└── static <-- Frontend single page
AWS CLI commands AWS CLI commands to package, deploy and describe outputs defined within the cloudformation stack:
sam build
sam deploy --guided
using deployed apigateway endpoint in static/index.js
const websocket_endpoint = "wss://#.execute-api.ap-northeast-1.amazonaws.com/Prod"
const fetch_messages_endpoint = "https://#.execute-api.ap-northeast-1.amazonaws.com/Prod/prod"