Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gipsh/sam-websocket-boilerplate
aws serverless boilerplate for a websocket app in golang
https://github.com/gipsh/sam-websocket-boilerplate
Last synced: 9 days ago
JSON representation
aws serverless boilerplate for a websocket app in golang
- Host: GitHub
- URL: https://github.com/gipsh/sam-websocket-boilerplate
- Owner: gipsh
- Created: 2020-09-04T16:17:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T21:44:40.000Z (over 4 years ago)
- Last Synced: 2024-04-22T00:31:09.478Z (9 months ago)
- Language: Go
- Size: 59.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sam-websocket-boilerplate
Example websockets application using lambdas and api gateway on AWS
![alt text](https://github.com/gipsh/sam-websocket-boilerplate/blob/master/aws-ws-bp.png)
## How it works
The app defines 3 lambda functions for handling the main events of a websocket service:
- Connections: when a new client connects the `connectHandler` is called and the connection is added
on the dynamodb table- Disconnections: when a client disconnects the `disconnectHandler` removes the entry from dynamodb
- Message received: when a message arrives to the service the `defaultHandler` is called and first uses
the api-gateway inerface to answert to the client and then retrieves the connections from dynamodb and updates
the array with new messages.## Deploy
Compile first
```bash
make
```And then just use serverles to deploy
```bash
serverless depoy
```