Consider using [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) to avoid having the front-end call the API as the timing is not reliable enough. As a starting point you can have a look at this [go-sse](https://github.com/alexandrevicenzi/go-sse)
Consider using Server-Sent Events to avoid having the front-end call the API as the timing is not reliable enough.
As a starting point you can have a look at this go-sse