mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 07:18:38 +00:00
Setting up initial support for sessions
This commit is contained in:
parent
b9609e71a2
commit
c46c2c67e4
2 changed files with 9 additions and 6 deletions
|
|
@ -7,7 +7,8 @@
|
|||
"derby": "*",
|
||||
"express": "3.x",
|
||||
"gzippo": ">=0.1.4",
|
||||
"racer-db-mongo": "*"
|
||||
"racer-db-mongo": "*",
|
||||
"connect-mongo": ">=0.1.9"
|
||||
},
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ http = require 'http'
|
|||
path = require 'path'
|
||||
express = require 'express'
|
||||
gzippo = require 'gzippo'
|
||||
MongoStore = require('connect-mongo')(express)
|
||||
derby = require 'derby'
|
||||
app = require '../app'
|
||||
serverError = require './serverError'
|
||||
|
|
@ -26,11 +27,12 @@ publicPath = path.join root, 'public'
|
|||
# .use(express.methodOverride())
|
||||
|
||||
# Derby session middleware creates req.model and subscribes to _session
|
||||
# .use(express.cookieParser 'secret_sauce')
|
||||
# .use(express.session
|
||||
# cookie: {maxAge: ONE_YEAR}
|
||||
# )
|
||||
# .use(app.session())
|
||||
.use(express.cookieParser 'secret_sauce')
|
||||
.use(express.session
|
||||
cookie: {maxAge: ONE_YEAR}
|
||||
store: new MongoStore(db: 'habitrpg', collection: 'express-sessions')
|
||||
)
|
||||
.use(app.session())
|
||||
|
||||
# The router method creates an express middleware from the app's routes
|
||||
.use(app.router())
|
||||
|
|
|
|||
Loading…
Reference in a new issue