/sinatra-faye-angular-demo

Sinatra API + Faye and Angular.js

Primary LanguageJavaScript

Sinatra JSON API + Faye PubSub and Angular.js

Overview

This is a simple Sinatra application using Faye to communicate with an Angular.js client

Backend

PubSub server with two entities:

PubSub server Faye with a Redis server as backend.

Sample backend server using a Sinatra app to show how messages can be received and sent from the server side.

Frontend

Javascript sample based on AngularJS and Faye's client side library

Instructions

  1. Clone the repository.
  2. Install the following gems:
  • sinatra
  • faye
  • faye-redis (from git not rubygems)
  • thin
  • json

bundle install

Usage

Run the Faye server on port 9001:

rackup faye.ru -s thin -E production -p 9001

Run the Sinatra server on IP 0.0.0.0:

rackup config.ru -s thin -o 0.0.0.0