Skip to content

Latest commit

 

History

History
42 lines (34 loc) · 1.03 KB

README.md

File metadata and controls

42 lines (34 loc) · 1.03 KB

Introduction

Websocket-quick-start it's a simple example of working with aws websockets and serverless

Quick Start

  1. Set-up your provider credentials. Watch the video on setting up credentials
  2. Install serverless via npm:
npm install -g serverless
  1. Install dependencies via npm:
npm install
  1. Deploy a Service:
sls deploy --stage dev

or

sls deploy --stage dev --aws-profile yourProfile

Test websocket

  1. To test the WebSocket API, you can use wscat, an open-source, command line tool.
npm install -g wscat
  1. On the console, connect to your published API endpoint by executing the following command:
wscat -c wss://{YOUR-API-ID}.execute-api.{YOUR-REGION}.amazonaws.com/{STAGE}
  1. To test the ping function, send a JSON message:
{"action": "ping"}
  1. You will receive the pong.