Khalid
Khalid

Reputation: 895

How to push notification to browser using node JS

I follow this sample code to push notification to browser, I follow the instructions and run the app using node server.js and I open the browser and run localhost:8000 and change text in example.xml and save it then the text pushed to browser (appear on screen browser).

But I still don't get it to implement to another app server, what I mean, for example I have a app using ruby on rails then I run the server on localhost:3000.

So now I have 2 running servers, first node.js app on localhost:8000 and second one my rails app on localhost:3000.

So how to pass notification from my node.js app to my rails app ?

Upvotes: 0

Views: 985

Answers (1)

Abs
Abs

Reputation: 3962

My suggestion is to use Redis or similar message queue for inter process communication.

Rails Push to Redis Queue. http://jimneath.org/2011/03/24/using-redis-with-ruby-on-rails.html

Node Reads off Redis queue https://github.com/mranney/node_redis

Upvotes: 1

Related Questions