Polling the server at regular intervals will be very inefficient. You could use Server Sent Events or Web Socket to achieve this efficiently. These methods sends updates only when changes happen on the server.
Learn More about SSE developer.mozilla.org/en-US/docs/Web/API/Server-s…. Not all browsers supports this though. or You could try sockets https://github.com/socketio/socket.io