Input from outside, e.g. LabView
Local installation:
conda create -n web_server python=3.9
conda activate web_server
pip install --upgrade pip
pip install -r requirements/local.txt
pip install -e .
These secrets will be printed out by the server. They are not used for authentication, so set them to whatever you want.
APP_USER
: app userAPP_PASSWORD
: app passwordMQTT_HOST
: mosquitto host, e.g. localhost (don't include the port)
To run the unit tests you need an MQTT broker. Start it:
cd docker/test_tracker_dcs_web
docker-compose up -d
Black:
black . --exclude _actions
Unit tests:
cd unittests
pytest
python web_server/app.py
Visit the API docs page to try the endpoints: http://localhost:5000/docs
The root endpoint will print the secrets you have set.
You can also try the other endpoints.
See the docker-compose stack, the web_server is already integrated.
To make a request to the root path:
curl localhost:8001/