-
Clone this repository.
-
cd in repository.
-
Run with Docker compose -
sudo docker-compose up
. -
Watch the app on http://localhost:5000.
-
Using Postman or any tool send POST request with header content-type --> text-plain and send any numerical string, to route
/therm/push
. -
To stop the service run,
docker-compose down
.
-
Install Redis, following the redis docs.
-
Clone the repository.
-
Create and Activate python virtual environment.
-
Install requirements
pip install requirements.txt
. -
Run Redis command in new terminal,
redis-server
. -
Run App,
python app.py
and wa it on http://localhost:5000. -
Using Postman or any tool send POST request with header content-type --> text-plain and send any numerical string to route
/therm/push
. We can send a POST request from a new terminal as well by running,curl -X POST -H "Content-Type: text/plain" -d '{"temperature":56}' http://localhost:5000/therm/push
. -
The value should get updated immediately on frontend without reloading it.
-
To stop the redis-server, press Ctrl+C or if the terminal got closed by mistake Redis would still be running, so run
redis-cli shutdown
to close it.