Serverless Websocket API for a cloud-based chat service. Deployed with AWS Lambda and Serverless Framework.
Requires Node >=16 (lts/gallium). If you are using nvm, then run
nvm install
from the project directoy
git clone https://github.com/jseashell/serverless-ws-chat-api.git
cd serverless-ws-chat-api
npm install
# Run unit tests with jest
npm test
Use wscat to interact with the websocket channel.
The <websocketApiId>
is available in your serverless deploy
output. Copy and paste it into the command below to use the websocket API from terminal.
wscat -c wss://<websocketApiId>.execute-api.us-east-1.amazonaws.com/dev
Environment variables are injected into the handler via serverless.yml config.
Deployment requires aws configure
on the deployment workstation
npx serverless deploy
This software is distributed under the terms of the MIT License.