I try to fetch data from the backend into the frontend but I have some problems. In my server.js I’m connected to a mongo store but I don’t know how the pass this data into the front-end.
In my Layout-Component i want to fetch the data
class FetchDemo extends React.Component {
constructor(props) {
super(props);
SocketIO is good for real time communication. I don’t believe it would be practical to deliver large amounts of data through web sockets, correct me if I’m wrong, but I think AJAX still wins.
True, but I’m comfortable with Socket.IO, and it’s really best for communications between your own pages and their server. If you want to set up an AJAX server, I recommend Express for sending back info through your own API. I usually use Express to serve Socket.IO pages.