Re-arranged routes, added comment blocks
This commit is contained in:
19
app.js
19
app.js
@ -32,7 +32,6 @@ var passportConf = require('./config/passport');
|
|||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mongoose configuration.
|
* Mongoose configuration.
|
||||||
*/
|
*/
|
||||||
@ -42,7 +41,6 @@ mongoose.connection.on('error', function() {
|
|||||||
console.error('✗ MongoDB Connection Error. Please make sure MongoDB is running.');
|
console.error('✗ MongoDB Connection Error. Please make sure MongoDB is running.');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Express configuration.
|
* Express configuration.
|
||||||
*/
|
*/
|
||||||
@ -109,20 +107,19 @@ app.post('/account/password', passportConf.isAuthenticated, userController.postU
|
|||||||
app.post('/account/delete', passportConf.isAuthenticated, userController.postDeleteAccount);
|
app.post('/account/delete', passportConf.isAuthenticated, userController.postDeleteAccount);
|
||||||
app.get('/account/unlink/:provider', passportConf.isAuthenticated, userController.getOauthUnlink);
|
app.get('/account/unlink/:provider', passportConf.isAuthenticated, userController.getOauthUnlink);
|
||||||
app.get('/api', apiController.getApi);
|
app.get('/api', apiController.getApi);
|
||||||
app.get('/api/foursquare', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getFoursquare);
|
|
||||||
app.get('/api/tumblr', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getTumblr);
|
|
||||||
app.get('/api/facebook', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getFacebook);
|
|
||||||
app.get('/api/scraping', apiController.getScraping);
|
|
||||||
app.get('/api/github', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getGithub);
|
|
||||||
app.get('/api/lastfm', apiController.getLastfm);
|
app.get('/api/lastfm', apiController.getLastfm);
|
||||||
app.get('/api/nyt', apiController.getNewYorkTimes);
|
app.get('/api/nyt', apiController.getNewYorkTimes);
|
||||||
app.get('/api/twitter', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getTwitter);
|
|
||||||
app.get('/api/aviary', apiController.getAviary);
|
app.get('/api/aviary', apiController.getAviary);
|
||||||
app.get('/api/paypal', apiController.getPayPal);
|
app.get('/api/paypal', apiController.getPayPal);
|
||||||
app.get('/api/paypal/success', apiController.getPayPalSuccess);
|
app.get('/api/paypal/success', apiController.getPayPalSuccess);
|
||||||
app.get('/api/paypal/cancel', apiController.getPayPalCancel);
|
app.get('/api/paypal/cancel', apiController.getPayPalCancel);
|
||||||
app.get('/api/steam', apiController.getSteam);
|
app.get('/api/steam', apiController.getSteam);
|
||||||
|
app.get('/api/scraping', apiController.getScraping);
|
||||||
|
app.get('/api/foursquare', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getFoursquare);
|
||||||
|
app.get('/api/tumblr', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getTumblr);
|
||||||
|
app.get('/api/facebook', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getFacebook);
|
||||||
|
app.get('/api/github', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getGithub);
|
||||||
|
app.get('/api/twitter', passportConf.isAuthenticated, passportConf.isAuthorized, apiController.getTwitter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAuth routes for sign-in.
|
* OAuth routes for sign-in.
|
||||||
@ -150,6 +147,10 @@ app.get('/auth/tumblr/callback', passport.authorize('tumblr', { failureRedirect:
|
|||||||
res.redirect('/api/tumblr');
|
res.redirect('/api/tumblr');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start Express server.
|
||||||
|
*/
|
||||||
|
|
||||||
app.listen(app.get('port'), function() {
|
app.listen(app.get('port'), function() {
|
||||||
console.log("✔ Express server listening on port %d in %s mode", app.get('port'), app.settings.env);
|
console.log("✔ Express server listening on port %d in %s mode", app.get('port'), app.settings.env);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user