Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

The code demonstrates how to consume an SSE stream in a ReactJS application.

For extra info if you are lost in the code see

HTML5 SSE (streaming data)

Setup for Python

Install Python - https://www.python.org/downloads/

...

Code Block
languagebash
pip install flask
pip install flask_cors

Unarchive the following

View file
namepython-datagenerator.zip

file below to a unique location on your machine (somewhere where it’s easy to find)

View file
namepython-datagenerator.zip

From the command line navigate to the folder where you have extracted this archive, and run the following command

Code Block
languagebash
python webServiceStream.py

Observe the output, it should conclude with a message saying Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)

...