I need to login with facebook and I am using Node.js on the server . But when I run on localhost I get TypeError: Object # does not have a "connect" method.
server.js
var express = require('express');
var app = express();
var port = process.env.PORT || 8080;
var neo4j = require('neo4j');
var passport = require('passport');
var flash = require('connect-flash');
var configDB = require('./config/database.js');
neo4j.connect(configDB.url);
require('./config/passport')(passport);
app.configure(function() {
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.set('view engine', 'ejs');
app.use(express.session({ secret: 'heyhellopeoplediscoverapp' }));
app.use(passport.initialize());
app.use(passport.session());
app.use(flash());
});
require('./app/routes.js')(app, passport);
app.listen(port);
console.log('The magic happens on port ' + port);
Below is the error I got from the console:
neo4j.connect(configDB.url); // connect to our database
^
TypeError: Object
at Object.<anonymous> (C:\node\easy-node-authentication-facebook\server.js:1
5:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Thanks in advance!
user3936984
source
to share