Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 933 Bytes

File metadata and controls

26 lines (18 loc) · 933 Bytes

crysocket

Travis build status Heroku

A basic Kemal toy application which serves a timestamp over websockets and a JSON endpoint.

Usage

First install Crystal if you don't already have it. Then in the checkout of this repository:

$ shards install
$ crystal build --release src/crysocket.cr
$ ./crysocket

To test, open a browser tab and enter the following into the developer javascript console:

ws = new WebSocket("wss://crysocket.herokuapp.com/socket")
ws.onmessage = msg => console.log(msg.data)

The timestamp should update approximately every second.

Alternatively, access the GET endpoint at https://crysocket.herokuapp.com/time