0

I'm starting playing with NodeJS and Socket.IO and I've got a question regarding communication between pages of my application.

I've got a Node JS script (get_new_data) which is periodicaly executed using a cron task. This script will get information through Internet, parse them and write them in a PG Database. This is ok.

I've got a secondary script (show_last_data) using Node/Express/Socket.io that displays the last information of the DB when it is executed. This is also ok, right now.

What I would like now, is that the script show_last_data would be notified when new data are inserted in the database and the corresponding display divs to be updated.

Can get_new_data connect to show_last_data even if it is not the server that produces the page ? Or should I manage this in another way ?

Thanks for help

Abhijit Pritam Dutta
  • 5,521
  • 2
  • 11
  • 17
boris_atw
  • 233
  • 1
  • 2
  • 10

1 Answers1

1

I've finally found a way to manage this using socket.io-client. This page was particulary helpful to solve my question : socket.io as a client

boris_atw
  • 233
  • 1
  • 2
  • 10