Cowboy WebSockets/Server Sent Events/COMET JSON API Guide

Initial Setup

Like in the Quick Start we will use rebar3

First let’s start installing the template we will use, this needs to be done only once:

mkdir -p ~/.config/rebar3/templates
git clone ~/.config/rebar3/templates/fn_push_app

Now we create the folder where our new project will live:

mkdir mypushapp
cd mypushapp

Then we install rebar inside our project folder:

chmod u+x rebar3

We can then create the project using the installed template, change mypushapp for the name of your project but if you do remember to change it in the following commands too:

./rebar3 new fn_push_app name=mypushapp

We can then run the project:

./rebar3 run