Skip to content

Proof-of-concept serverless web socket API for streaming live chat data

License

Notifications You must be signed in to change notification settings

jseashell/serverless-ws-chat-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Websocket Chat API

Serverless Websocket API for a cloud-based chat service. Deployed with AWS Lambda and Serverless Framework.

Install

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

Test

# 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

Environment variables are injected into the handler via serverless.yml config.

Deploy

Deployment requires aws configure on the deployment workstation

npx serverless deploy

License

This software is distributed under the terms of the MIT License.

Releases

No releases published

Packages

No packages published