Flask server for Aptiv project currently serving four endpoints.
[GET]/Serves the website[POST]/api/sensors/<rpi_id>Posts a new sensor reading type to the server<rpi_id>can be one of the following ids:driver,back,middle, orpassenger.- The Body should be in
JSONformat. Example body:{ "temperature":{"value":"20"}, "pressure":{"value":"20"}, "altitude":{"value":"20"}, "sound":{"value":"20.3"}, "light":{"value":"12.6"}, "humidity":{"value":"65"}, "gain":{"value":"20"}, "lux":{"value":"20"}, "ir":{"value":"20"}, "full":{"value":"20"} }
[GET]/api/sensors/<rpi_id>Gets the current sensor reading values for theRaspberry Pispecified in the parameter[PUT]/api/sensors/<rpi_id>Updates the sensor reading values for theRaspberry Pispecified in the parameter
- Git
- Code Editor (e.g. PyCharm, VSCode, Atom, etc.)
- Flask WebApp/WebServer requires python3 & pip3 to run.
- With SSH
git clone git@github.com:hanien/dit827server.git
- With HTTPS
git clone https://github.com/hanien/dit827server.git
Open your Terminal Command Line and type:
-
cd dit827server -
$ pip install Flask
Open your Terminal Command Line again and type:
-
python server.py
- Open your browser and go to the link: http://127.0.0.1:5000/ OR http://localhost:5000/
