replasing 'got' with 'request' package;

UI for garden watering (start/stop);
This commit is contained in:
d-popov
2020-06-16 20:35:22 +03:00
parent 6a8a895f69
commit 5f02e7fb61
7 changed files with 640 additions and 450 deletions

View File

@@ -7,7 +7,7 @@ var con = mysql.createConnection({
database : 'iot'
});
const got = require('got');
//const got = require('got');
exports.findByName = function(fieldName, days, cb) {
process.nextTick(function() {
@@ -44,7 +44,7 @@ exports.getFromDht = function(url, cb)
{
(async () => {
try {
const dht = await got('http://192.168.1.126/json')
//! const dht = await got('http://192.168.1.126/json')
var j = JSON.parse(body);
if(j.dht && j.dht.hum <= 100 && j.dht.hum >= 0){
exports.insert(0, "A23_DHT", dht.body, cb);