This is a Python web API
- Python 3 (initially written in 3.9.5)
Install requirements:
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
Run the server:
flask run
Note that you will need to restart the server on code change.
Hello world
curl http://127.0.0.1:5000/
Create sensor
curl -X POST http://127.0.0.1:5000/create-sensor \
-H 'Content-Type: application/json' \
--data '{"frequency": 2 }'
Poll to update all sensors
curl -X GET http://127.0.0.1:5000/poll
Display all sensors
curl -X GET http://127.0.0.1:5000/all-sensors