Can't call method 'use' of undefined
I have a problem embedding passport in node.js express.
I try to follow various tutorials but it just won't work.
This time an error occurs:
My code looks like this:
In app.js:
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
// Configuring Passport
var passport = require('passport');
var expressSession = require('express-session');
// TODO - Why Do we need this key ?
app.use(expressSession({secret: 'mySecretKey'}));
app.use(passport.initialize());
app.use(passport.session());
Any idea why this isn't working? I have set up express session, passport, passport-local, etc.
+3
source to share