Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonprickett/server-sent-events-demo
Server Sent Events Demo for San Diego JS Meetup using Node, HTML, JavaScript, CSS.
https://github.com/simonprickett/server-sent-events-demo
javascript node-js nodejs server-sent-events
Last synced: 2 months ago
JSON representation
Server Sent Events Demo for San Diego JS Meetup using Node, HTML, JavaScript, CSS.
- Host: GitHub
- URL: https://github.com/simonprickett/server-sent-events-demo
- Owner: simonprickett
- License: mit
- Created: 2017-12-07T04:41:21.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-05-30T18:21:17.000Z (over 2 years ago)
- Last Synced: 2024-04-14T23:32:15.579Z (9 months ago)
- Topics: javascript, node-js, nodejs, server-sent-events
- Language: JavaScript
- Homepage: https://simonprickett.dev/a-look-at-server-sent-events/
- Size: 773 KB
- Stars: 40
- Watchers: 2
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Server Sent Events Demo
A small Server Sent Events demo for [San Diego JS](http://sandiegojs.org/) Meetup using Node, HTML, JavaScript, CSS. I also wrote a [post on my website](https://simonprickett.dev/a-look-at-server-sent-events/) about this topic wihich includes a video of me presenting about it at the Meetup.
![demo](sse_demo.gif)
Slides can be found [here](https://docs.google.com/presentation/d/1ueJ6ewO3i34OXRBI8mY6g26cKbkPDf4cNSrtX4ULBx4/edit?usp=sharing).
## Running this Project
The following instructions assume Mac OS / Linux system with Python installed (to provide a simple web server).
### Get the Code using a Terminal Window
```bash
$ git clone https://github.com/simonprickett/server-sent-events-demo.git
$ cd server-sent-events-demo
```### Start the Server in a Terminal Window
```bash
$ cd src/server
$ npm install
$ npm start
```### Start the Client in another Terminal Window
```bash
$ cd src/client
$ python -m SimpleHTTPServer
```or...
```bash
$ cd src/client
$ python3 -m http.server
```Then point a browser at `http://localhost:8000/`.
## Reference Materials
* [MDN Server Sent Events Guide](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
* [HTML 5 Rocks Tutorial](https://www.html5rocks.com/en/tutorials/eventsource/basics/)
* [O'Reilly High Performance Browser Networking SSE page](https://hpbn.co/server-sent-events-sse/)
* [Data source for cat facts](https://github.com/vadimdemedes/cat-facts)