Skip to content

Instantly share code, notes, and snippets.

@ChrisCates
Forked from dallas-x/authBooks
Created May 12, 2017 16:12
Show Gist options
  • Save ChrisCates/afb0bb65ca8eb47bcbd727e0bd54cfaf to your computer and use it in GitHub Desktop.
Save ChrisCates/afb0bb65ca8eb47bcbd727e0bd54cfaf 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