Skip to content

Instantly share code, notes, and snippets.

@newz2000 newz2000/app.js Secret
Created Jul 22, 2014

Embed
What would you like to do?
var contacts = require('./routes/contacts');
var passport = require('passport');
// passport configured and working
// ...
app.use('/contacts/', contacts);
var passport = require('passport');
var express = require('express');
var router = express.Router();
var Account = require('../models/account');
var Contact = require('../models/contact');
router.use(passport.authenticate('local', { failure: '/auth/login' }));
router.get('/', function(req, res) {
Contact.find( function(err, contacts, count) {
res.render('list', {contacts: contacts});
});
});
// router.get('/', passport.authenticate('local'), function(req, res) {
// Contact.find( function(err, contacts, count) {
// res.render('list', {contacts: contacts});
// });
// });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.