0
votes

What I want to achieve is having a react application receive data posted to a Node-js server. Currently, the Node server receives a POST from an external source with a list of items. When the Node server receives the data, I want to send the data to the react application. This data will be used in the react application to display the listed items. How would I proceed to make this possible? Any advice is appreciated!

Thank you!

1

1 Answers

1
votes

You can do this using Web Sockets. It would look something like this

  1. Your app connects to your API and maintains a socket
  2. The external source will POST to your API
  3. API handles the POST request
  4. Then the API passes some data on to the React app over the web socket
  5. Your app consumes said data
  6. Profit?

Socket.IO is a popular JavaScript library for web sockets with fallbacks and stuff.