Browse Source

mongo passport

windhamdavid 4 years ago
parent
commit
e00399e322
2 changed files with 23 additions and 2 deletions
  1. 15 2
      app.js
  2. 8 0
      package.json

+ 15 - 2
app.js

@@ -1,8 +1,10 @@
 /*global require:true, __dirname:true */
 
 var express = require('express');
-var session = require('express-session');
 var exphbs = require('express-handlebars');
+var session = require('express-session');
+var expressValidator = require('express-validator');
+var flash = require('express-flash');
 var cookieParser = require('cookie-parser');
 var bodyParser = require('body-parser');
 var favicon = require('serve-favicon');
@@ -11,6 +13,12 @@ var events = require('events');
 var http = require('http');
 var path = require('path');
 var logger = require('morgan');
+var lusca = require('lusca');
+var methodOverride = require('method-override');
+var _ = require('lodash');
+var mongoose = require('mongoose');
+var MongoStore = require('connect-mongo')(session);
+var passport = require('passport');
 
 var app = express();
 
@@ -18,9 +26,14 @@ var config = {
   development: require('./config/config-dev.js'),
   production: require('./config/config.js')
 };
-var secrets = require('./config/secrets');
+var secure = require('./config/secure');
 var passportConf = require('./config/passport');
 
+mongoose.connect(secure.db);
+mongoose.connection.on('error', function() {
+  console.log('MongoDB Connection Error!');
+  process.exit(1);
+});
 
 var homeController = require('./controllers/home');
 var userController = require('./controllers/user');

+ 8 - 0
package.json

@@ -15,13 +15,21 @@
   "dependencies": {
     "bcryptjs": "^2.3.0",
     "body-parser": "^1.14.1",
+    "connect-mongo": "^0.8.2",
     "cookie-parser": "^1.3.5",
     "debug": "~2.2.0",
     "errorhandler": "^1.4.2",
     "express": "^4.13.3",
+    "express-flash": "0.0.2",
     "express-handlebars": "^2.0.1",
     "express-session": "^1.12.1",
+    "express-validator": "^2.18.0",
+    "lodash": "^3.10.1",
+    "lusca": "^1.3.0",
+    "method-override": "^2.3.5",
+    "mongoose": "^4.2.9",
     "morgan": "~1.6.1",
+    "passport": "^0.3.2",
     "serve-favicon": "~2.3.0"
   },
   "devDependencies": {