Skip to content

Instantly share code, notes, and snippets.

@newz2000

newz2000/app.js Secret

Created July 22, 2014 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save newz2000/a73a493839a7de58e350 to your computer and use it in GitHub Desktop.
Save newz2000/a73a493839a7de58e350 to your computer and use it in GitHub Desktop.
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