A simple API written in Express.js that allows you to display your Raspberry Pi temperature on a cool website. Is it overkill? Well, if you are here, that means you were looking for it right?
Please make sure you have both npm and Node.js installed.
Simply run the following command to install to install the required dependencies on your system:
npm i
First, run the bash script that monitors your Raspberry Pi temperature:
chmod +x tempmon.sh
./tempmon.sh
Then, start the Express server to make data available through the Express API:
npm start
Once everything is running, you can access your Pi temperature at GET http://localhost:3000/temperature.
Alternatively, you can try the API directly with an actual website. There is an example website in the frontend folder. You may serve the website statically with a webserver such as Apache or Nginx or access it directly from your browser.