Skip to content

Instantly share code, notes, and snippets.

@dallas-x
Created May 12, 2017 16:10
Show Gist options
  • Save dallas-x/26a65a6fe44e007d512f62f5ece93b9b to your computer and use it in GitHub Desktop.
Save dallas-x/26a65a6fe44e007d512f62f5ece93b9b to your computer and use it in GitHub Desktop.
for chris
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