node.js - Process not waiting until get the data for api in nodejs -
i new nodejs. process not waiting until data mailgun api mail validation.
here code
var validator = require('mailgun-validate-email')('pubkey-xxxxxxxx') validator(req.body.email, function (err, results) { console.log(results) // times getting response. of time getting undefind. if(results.is_valid == true ) { user.findone({ 'emails.email' : req.body.email}, function(err, doc){ console.log(doc) }) } })
Comments
Post a Comment