diff options
author | Lurifax <stianalexanderolsen@gmail.com> | 2013-05-01 22:20:18 +0200 |
---|---|---|
committer | Lurifax <stianalexanderolsen@gmail.com> | 2013-05-01 22:20:18 +0200 |
commit | 464d4717ace36646db7636f2ebc7701a921c75dd (patch) | |
tree | 670d7fa67e7633ca818cc5b48e8886fab2d6ab3f /routes.js | |
parent | Changes in text (diff) | |
parent | added generateRandomAccessToken method (diff) | |
download | Divid-464d4717ace36646db7636f2ebc7701a921c75dd.tar.gz |
Changes in text in home.ejs
Diffstat (limited to 'routes.js')
-rw-r--r-- | routes.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/routes.js b/routes.js new file mode 100644 index 0000000..d597ae8 --- /dev/null +++ b/routes.js @@ -0,0 +1,67 @@ + +/** + * Dependencies + */ + +var users = require('./controllers/users') + , system = require('./controllers/system'); + + +/* + * ============================================================ + * Routes + * + */ + +module.exports = function(app, passport, auth) { + app.get('/', system.index); + + app.get('/test', system.test); + + app.get('/home', system.home); + + app.get('/faq', system.faq); + + app.get('/login', users.login); + + app.get('/signup', users.signup); + + app.post('/signup', users.create); + + + app.post('/test', users.signin); + + app.get('/auth/facebook', passport.authenticate('facebook', { failureRedirect: '/test' }), users.signin); + + app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/test' }), function(req, res) { + console.log('/auth/facebook/callback --- ' + req.user.username); + res.redirect('/dashboard'); + }); + + app.get('/auth/twitter', passport.authenticate('twitter', { failureRedirect: '/test' }), users.signin); + app.get('/auth/twitter/callback', passport.authenticate('twitter', { failureRedirect: '/test' }), users.authCallback); + + app.get('/logout', users.logout); + + + /** + * REQUIRES LOGIN + * ============================================================ + */ + + + app.get('/dashboard', auth.requiresLogin, system.dashboard); + + + app.get('/project', auth.requiresLogin, system.project); + + app.get('/project/new', auth.requiresLogin, system.newProject); + + app.post('/project/new', auth.requiresLogin, system.postNewProject); + + app.get('/project/:short', auth.requiresLogin, system.project); + + app.get('/project/:short/participants', auth.requiresLogin, system.projectParticipants); + + app.post('/project/:short/participants', auth.requiresLogin, system.postProjectParticipants); +}; |