add session and cookie and passport config for server

This commit is contained in:
catarak 2016-05-13 16:04:16 -04:00
parent fdd946b961
commit d8bdc9a232
2 changed files with 16 additions and 0 deletions

View File

@ -35,6 +35,7 @@
"dependencies": {
"axios": "^0.12.0",
"babel-core": "^6.8.0",
<<<<<<< HEAD
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.15.1",
"classnames": "^2.2.5",
@ -49,6 +50,14 @@
"passport-github": "^1.1.0",
"passport-jwt": "^2.0.0",
"passport-local": "^1.0.0",
=======
"body-parser": "^1.15.1",
"classnames": "^2.2.5",
"codemirror": "^5.14.2",
"cookie-parser": "^1.4.1",
"express": "^4.13.4",
"mongoose": "^4.4.16",
>>>>>>> add session and cookie and passport config for server
"react": "^15.0.2",
"react-dom": "^15.0.2",
"react-inlinesvg": "^0.4.2",

View File

@ -25,6 +25,13 @@ import users from './routes/user.routes';
//Body parser, cookie parser, sessions, serve public assets
//Body parser, cookie parser, sessions, serve public assets
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(cookieParser());
app.use(session({secret: 'steve brule'}));
app.use(passport.initialize());
app.use(passport.session());
app.use(Express.static(path.resolve(__dirname, '../static')));
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());