I need to send data from my backend to my frontend (sort of a notification system). My backend is a simple Node JS server that works fine and my frontend is a simple web page using webpack and JS. My goal is to send data from my server to my web client. I tried to solve this by using a notification system with Service Workers. Uunfortunately in my service worker 'push' listener, I can not put the notification content in my actual web page, for instance I tried this : , but its not working because apparently we can not use 'window' or 'document' object inside a service worker... so I have two questions please : 1. Is there an easier way to send data from a server to client? 2. Using service workers, is there a way to send the data from the service worker to the web client ? Thank you for all your help !
Aucun commentaire:
Enregistrer un commentaire