Reputation: 4818
I'm developing an Angular 4 app that connects to a REST API developed in NodeJS/Express/MySQL. I'm looking for a way to notify any connected clients when there is a change in the database, so they reload their datasets. I've done some searches on Google but I don't know the technical term of what I'm looking for, so I didn't find anything useful.
Can someone point me some resource on this subject? Thanks!
Upvotes: 0
Views: 1283
Reputation: 4818
Thanks!
Time to learn some new things... I think I'll start with HTML5 Server Send Events, I think it'll be more than enough for what I need.
Cheers,
Upvotes: 0
Reputation: 93
If you want to visualize changes "live", you should try websockets.
With websockets you could notify any client about any upcoming changes in data, think of it as some kind of chat between server and clients.
There's socket.io for Node.js developers and plenty of tutorials about how to set it up and get it running.
Upvotes: 1
Reputation: 5848
You have two options avaliable
1)HTML5 serversent events
A server-sent event is when a web page automatically gets updates from a server.
https://www.w3schools.com/html/html5_serversentevents.asp
2)Socket.io
Based on my experience for simple realtime updates HTML5 server sent is enough
Upvotes: 1