This repo is an example of how to:
- Start an http server with aiohttp
- Create a route on that server to serve WebSockets
- Start a background job with that server
- Send updates from the background job to all open WebSocket connections
- Receive and parse those updates in JavaScript
- Update the HTML of a page with JavaScript based on received updates
To run this app:
- Clone the project and
cd
into the directory - Install the dependencies (just
aiohttp
) withpipenv install
- Start the application with
pipenv run main.py