Skip to content

Instantly share code, notes, and snippets.

@wildan3105
Created August 16, 2017 04:31
Show Gist options
  • Save wildan3105/0854da020028c6eabecdb2fd945f09aa to your computer and use it in GitHub Desktop.
Save wildan3105/0854da020028c6eabecdb2fd945f09aa to your computer and use it in GitHub Desktop.
app.post('/results', function(req, res){
var post = {}
post.date = new Date(),
post.temp = req.body.temp
sql.query('INSERT INTO analog_read SET ?', post, function(err, results, fields){
if(err) throw err;
console.log('sent success with value : ', post.temp)
res.json({'status':'success!'})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment