Facebook API page and controller
This commit is contained in:
4
app.js
4
app.js
@ -28,7 +28,7 @@ app.set('port', process.env.PORT || 3000);
|
||||
app.set('views', __dirname + '/views');
|
||||
app.set('view engine', 'jade');
|
||||
app.use(express.logger('dev'));
|
||||
app.use(express.errorHandler());
|
||||
app.use(express.errorHandler({showStack: true, dumpExceptions: true}));
|
||||
app.use(express.favicon());
|
||||
app.use(express.cookieParser());
|
||||
app.use(express.bodyParser());
|
||||
@ -56,6 +56,7 @@ app.get('/partials/:name', home.partials);
|
||||
app.get('/api', api.apiBrowser);
|
||||
app.get('/api/foursquare', passportConf.ensureAuthenticated, api.foursquare);
|
||||
app.get('/api/tumblr', passportConf.ensureAuthenticated, api.tumblr);
|
||||
app.get('/api/facebook', passportConf.ensureAuthenticated, api.facebook);
|
||||
|
||||
app.get('/contact', contact.getContact);
|
||||
app.post('/contact', contact.postContact);
|
||||
@ -69,6 +70,7 @@ app.get('/auth/google/callback', passport.authenticate('google', { successRedire
|
||||
|
||||
app.get('/auth/foursquare', api.foursquareAuth);
|
||||
app.get('/auth/foursquare/callback', api.foursquareCallback);
|
||||
|
||||
app.get('*', home.index);
|
||||
|
||||
|
||||
|
@ -14,7 +14,6 @@ var foursquare = require('node-foursquare')({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
exports.apiBrowser = function(req, res) {
|
||||
console.log(req.user);
|
||||
res.render('api', {
|
||||
@ -47,14 +46,20 @@ exports.foursquare = function(req, res) {
|
||||
|
||||
|
||||
exports.tumblr = function(req, res) {
|
||||
|
||||
res.render('api/tumblr', {
|
||||
title: 'Tumblr API',
|
||||
user: req.user
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
exports.facebook = function(req, res) {
|
||||
res.render('api/facebook', {
|
||||
title: 'Facebook API',
|
||||
user: req.user
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* GET /auth/foursquare
|
||||
* Display Foursquare authentication screen
|
||||
|
@ -8,3 +8,5 @@ block content
|
||||
a(href='/api/foursquare') Foursquare
|
||||
li
|
||||
a(href='/api/tumblr') Tumblr
|
||||
li
|
||||
a(href='/api/facebook') Facebook
|
9
views/api/facebook.jade
Normal file
9
views/api/facebook.jade
Normal file
@ -0,0 +1,9 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
.page-header
|
||||
h1
|
||||
i.fa.fa-facebook-square
|
||||
| Facebook API
|
||||
if !user.tokens.facebook
|
||||
a.btn.btn-large.btn-primary(href='/auth/facebook') Get Facebook Token
|
Reference in New Issue
Block a user