const utils = require('../utils/utils.js'); const Promise = require('promise'); const sql = require('../utils/sql'); var processLogin = function(result, request) { return new Promise(function(resolve, reject) { utils.getPostData(request).then(function(postData) { return sql.checkLogin(postData); }).then(function(loginResult) { if(loginResult.pass) { request.session.user = loginResult.user; result.write(""); } resolve(); }).catch(function(err) { console.log(err); resolve(); }) }); }; module.exports= { main: function(result, request) { console.log("main of login.js"); result.write("