This is a server used to get data from various sensors. For more information about how this is being used see www.amalgamatecompost.com To use this API see the DOCS below
This is documentation on how to access the API you create on your composter if you use my code
on my composter these routes are hit using ngrok so my requests look like
http://ngrok.io/test
Your requests will look different depending on how you run your composter. They may be ngrok or they may include a port if you are choosing to port forward.
This request will return an object with a key result and a value "test" this is a good route to test initial set up to see if you can access the api
Example:
{"result": "test"}
This request will return an object with a keys of "temp", "humidity" and "dewPoint" and values equivalent to the numeric results produced by the sht1x sensor
Example:
{"temp": 22,
"humidity": 21.4,
"dewPoint": 81}
</div>
<hr>
<div class="requestsinner">
<h1>
Route <code> /data </code>
<br>
<div class="requesttype"> GET </div>
</h1>
<div class="resultdata">
<p> This request will return an object with a keys of "data" and an array that contains another array of each data reading from the database. This includes temperature, humidity, dewPoint, date(), serial_id of the composters computers cpu </p>
<br> Example:
<br>
<div class="code">
<code> {data:[ [ 22.26, 34.30, 9.222, "2016-09-19:05:04", "00000002499488"]]}
</code>
</div>
</div>
</div>
<hr>
<div class="requestsinner">
<h1>
Route <code> /water </code>
<br>
<div class="requesttype"> POST </div>
</h1>
<div class="resultdata">
<p> This request will water the compost and then return an object with a keys of "result" and a value of "finished water"</p>
<br> Example:
<br>
<div class="code">
<code> {"result": "finished water"}
</code>
</div>
</div>
</div>
<hr>
<div class="requestsinner">
<h1>
Route <code> /turn </code>
<br>
<div class="requesttype"> POST </div>
</h1>
<div class="result data">
<p> This request will turn the compost and then return an object with a keys of "result" and a value of "finished turn"</p>
<br>
Example:
<br>
<div class="code">
<code>
{"result": "finished turn"}
</code>
</div>
</div>
</div>