Skip to content

fzunino/sse-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server-Sent Events Example

Node.js example app to try out SSE.

Based on https://www.digitalocean.com/community/tutorials/nodejs-server-sent-events-build-realtime-app with some fixes applied.

Adds Message Id (id:) and Custom Event types (event:)

Install & Run

  • Run
$ npm install
$ node server.js
  • Connect to EventSream
$ curl  -H Accept:text/event-stream http://localhost:4000/events
  • Push Events
$ curl -X POST  -H "Content-Type: application/json"  -d '{"momma": "swamp_princess", "eggs": 40, "temperature": 32}' -s http://localhost:4000/nest

About

Node.js example app to try out SSE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published