How to setup backend stuffs
server/lambda/index.ts
. It is very similar to Express just with more support for serverless.
AWS
object. We are using AWS CDK, which allows for easy serverless development, the API reference documentation can be found here.
ws
library, which is supported by AWS API Gateway. Documentation for ws
can be found here.
All Websocket files are found in server/websocket
and each route has its own file. A simple route consists of the handler, and even and any other code.
server/lib/websocket-stack.ts
. There are two steps that you need to do.
You will first need to add the handler. Add it underneath the AWS Lambda Node.js functions handlers haeder comment.