Skip to content

Example of work with WebSockets on the Serverless Framework

Notifications You must be signed in to change notification settings

CryOnics1/websocket-quick-start

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Example of work with WebSockets on the Serverless Framework

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published