Created
May 12, 2017 16:10
-
-
Save dallas-x/26a65a6fe44e007d512f62f5ece93b9b to your computer and use it in GitHub Desktop.
for chris
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var authRouter = express.Router(); | |
var ejs = require('ejs'); | |
const fs = require('fs'); | |
const execFile = require('child_process').execFile; | |
function qa_tools(){ | |
console.log('running...') | |
const child = execFile('qa-pat-links', | |
['-P', 'http://www.apple.com/iphone/'], | |
(error, stdout, stderr) => { | |
if (error) { | |
throw error; | |
} | |
console.log('completed'); | |
console.log(stdout); | |
}); | |
fs.readFile('report.html',function(err, html) { | |
if(err){ | |
console.log(err); | |
} | |
}); | |
} | |
var router = function (nav){ | |
authRouter.route('/signup') | |
.post( function(req, res){ | |
console.log(req.body); | |
req.login(req.body, function(){ | |
res.redirect('./profile'); | |
}) | |
}); | |
authRouter.route('/profile') | |
.get(function(req, res){ | |
qa_tools(); | |
res.json(req.user); | |
}); | |
return authRouter; | |
}; | |
module.exports = router; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment