Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 617 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 617 Bytes

SERVER SENT EVENTS (SSE) EXAMPLE

Using node and express.

Install dependencies

npm i

Run

node server.js

The server must be running on port 3000.

Testing

Browser

You can see it working on the browser accessing http://localhost:3000/.

CLI

You can also check the events on your terminal running:

curl localhost:3000/stream

Source

Based on Josh's and Ggorlen's answers to this Stackoverflow question.