Frontend is Angular, backend is .Net if it's important
I have a sensor from which I get data periodically through my backend and store it in the database. (Basically it's a sensor from third party company which collects data and sends that data via RESTapi to my backend, then i store it in the database )
The only option I know about is having a timer on the frontend which sends get method to the backend every few seconds/minutes which notifies logged in user about changes.
I'm sure or at least I'm hoping that there is some other smarter and more direct way about getting that info to logged in users about those changes/notifications that I get from third party apps/jobs.
Tnx
1 Answer 1
If I resume, you would like to be notified when your back is updated by your third party so you can fetch the new data.
There are several possibilities but I will only detail one: The websocket.
You can use WebSockets to establish a persistent, bidirectional communication channel between your front and your back. When your third party will update your database, you can send the notification though the WebSocket to inform your front.
You can follow this article for exmaple: Use WebSocket on .Net Core & Angular with SignalR