Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 925 Bytes

README.md

File metadata and controls

61 lines (49 loc) · 925 Bytes

Apollo-radio

The websocket server for Armstrong

Prerequirememnt

  • Redis
  • Ruby 1.9+

Setup

  • Install Gem
bundle install
  • Start both websocket server and API server
rake apollo:start
  • or just start websocket server
rake apollo:ws_server
  • just start api server
rake apollo:api_server

Test in Front-End

open developmemnt tool and type javascript

  • connect with websocket server
init_channel('apollo');
  • send message
var data_hash = {channel: 'apollo', msg: 'call armstrong'};
ws.send(JSON.stringify(data_hash));

Push message end-point

  • Specify channel with parameter.
  • Put data(JSON format) in body will send to client.

here is example:

  • POST request
http://localhost:4567/armstrong_push?channel=apollo
  • data in the body
{
    "data": {
        "msg": "rock and roll"
    }
}