A WebRTC signalling service for a simple messaging app using AWS Lambda and Redis.
- a Redis instance that can be accessed from the internet
npm i
- Run
serverless package
- Create a Lambda with Node.js 12.x runtime
- Upload the
.zip
file in./serverless
- Set the handler to
src/handler.main
- Set the
REDIS_PORT
,REDIS_HOST
, andREDIS_PASSWORD
environment variables - Deploy the funtion
- Create a WebSocket API with the following routes:
$disconnect
,addAnswer
,addIceCandidate
,addOffer
,joinRoom
,receiveAnswer
and route selection expression set to$request.body.action
- Add lambda proxy integration to all the routes, add integration response as well
- Go back to lambda and add
Allow: execute-api:ManageConnections
onarn:aws:execute-api{region}:{account-id}{api-id}:{stage}/POST/@connections/*
- Deploy API
This project has been generated using the aws-nodejs-typescript
template from the Serverless framework.