closer to getting ajax to work

This commit is contained in:
Michael Q Larson
2014-11-06 17:38:47 -08:00
parent 944f4d6a1d
commit 86d433aaba
5 changed files with 71 additions and 56 deletions

10
app.js
View File

@@ -165,6 +165,10 @@ app.post('/api/venmo', passportConf.isAuthenticated, passportConf.isAuthorized,
app.get('/api/linkedin', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getLinkedin);
app.get('/api/instagram', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getInstagram);
app.get('/api/yahoo', apiController.getYahoo);
app.post('/completed_challenge', function(req, res){
req.user.challengesCompleted.push(req)
console.log("pushed #{req} to user");
});
/**
* OAuth sign-in routes.
@@ -212,9 +216,6 @@ app.get('/auth/venmo/callback', passport.authorize('venmo', { failureRedirect: '
res.redirect('/api/venmo');
});
/**
* 500 Error Handler.
*/
@@ -229,4 +230,5 @@ app.listen(app.get('port'), function() {
console.log('Express server listening on port %d in %s mode', app.get('port'), app.get('env'));
});
module.exports = app;
module.exports = app;