ThisissoonFM Socket Server
The ThisissoonFM socket server interfaces redis pub/sub events with web clients via sockets.
The socket messages use the same names as the redis events emitted from FM-API, camelCased and prefixed with
For a full list of the events see: FM-API docs
In each case data from the redis message is passed through the socket message to the client.
Ensure you have the following tools before you start developing this application:
The ThisissoonFM socket server is designed to be run under docker. This section will describe how to get the application up and running under docker.
Building the Docker Image
First step is to get docker installed on your system. You will need to use Boot2Docker on OSX/Windows and you can follow the basic instructions here but shout for help if you are not sure:
Once you have docker running the first thing to do is build the docker image. In future we may host the latest image build on docker hub or similar.
$ docker build -t soon/fm-socket .
Running the Application
$ docker run --rm -it soon/fm-socket
The following configuration can be set via Environment Varibales:
SOCKET_LOG_LEVELLogging level - defaults to
info, setting to
verbosewill log all emitted events
REDIS_URISet the redis server to listen to - defaults to
REDIS_CHANNELSet the redis channel to listen to - defaults to
Running in Development
To run the application in development, we're using fig.
Fig defines all the services that make up the app in fig.yml and runs them together in an isolated environment. Simply run:
$ fig up
To attach your local code for development, un-comment the relevant application volumes in fig.yml.
Check it out at http://localdocker:8080
Testing uses the mocha framework, with istanbul for coverage reports
$ grunt test
Running Tests in Development
To run the test suite with auto-reruns on code changes, run:
$ grunt dev