This is a simple application that serves tasty WebSockets to your users with faye-websocket, Puma, and Sinatra.
Check out the live demo .
Credit: install OpenSSL and Puma
unpack the OpenSSL Developer Package, e.g. in D:\openssl (use 7Zip or PeaZip)
gem install puma -v '2.6.0' -- --with-opt-dir=d:\openssl
To install all the dependencies, run:
bundle install
Next the app requires some env vars for configuration. A sample .env.sample
is provided for running the app locally. You can copy .env.sample
to .env
which foreman will pick up.
Ensure your local redis is running. I am using redis-server.exe on Windows. To set up download redis-2.4.6-setup-32-bit.exe from https://github.com/rgl/redis/downloads
Using foreman we can boot the application.
$ foreman start
You can now visit http://localhost:5000 to see the application.
Open in multiple browser tabs to test.
Broadly speaking you can follow the instructions in the docs
However, this example uses Redis so won't work unless you have added Redis Cloud add on before starting your dyno. You'll need to have added a credit card to your Heroku account first -even for the free tier.
When added you'll get a Redis Cloud connection string in ENV[REDISCLOUD_URL] under Settings->Config Variables. (You can use this in your local version .env file first to test it is working).