This project provides a simple example of using server-sent events in a client-server application. The server is implemented in express node js and the clients in react and react native.
The server exposes an endpoint which every five seconds sends the current time to the subscribed clients.
In both cases, browser and mobile, you can see the real time updating.
Clone the repository.
Install dependencies:
npm install
To run:
node index.js
Access from:
http://localhost:3001/
Install dependencies:
npm install
To run:
npm start
Access from:
http://localhost:3000/
You should have expo installed. For Installing dependencies:
npm install
To run:
expo start