https://github.com/sonicoder86/server-sent-events-showcase
https://github.com/sonicoder86/server-sent-events-showcase
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sonicoder86/server-sent-events-showcase
- Owner: sonicoder86
- Created: 2020-06-15T10:02:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T14:33:50.000Z (almost 6 years ago)
- Last Synced: 2025-01-06T00:44:21.097Z (over 1 year ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# server-sent-events-showcase
[](https://david-dm.org/blacksonic/server-sent-events-showcase)
Basic setup for Server Sent Events (SSE) with Koa server.
```
npm install
npm start // run frontend, available on http://localhost:8080
npm run start-server // run backend, available on http://localhost:3000
// Send message to specific user, actual user is printed to frontend
http://localhost:3000/events/:user/emit/:message?event=eventType
http://localhost:3000/events/user_123/emit/HelloMessage
http://localhost:3000/events/user_123/emit/HelloMessage?event=secondary
```