node.js - NodeJS: I can't make connect-redis work with express -


this code :

var express = require('express'); var redisstore = require('connect-redis')(express); 

and error :

  redisstore.prototype.__proto__ = store.prototype;                                         ^ typeerror: cannot read property 'prototype' of undefined     @ module.exports (/home/cherif/bureau/twimbee/server/gamma/node_modules/connect-redis/lib/connect-redis.js:96:41)     @ object.<anonymous> (/home/cherif/bureau/twimbee/server/gamma/index.js:2:42)     @ module._compile (module.js:456:26)     @ object.module._extensions..js (module.js:474:10)     @ module.load (module.js:356:32)     @ function.module._load (module.js:312:12)     @ function.module.runmain (module.js:497:10)     @ startup (node.js:119:16)     @ node.js:902:3 

please help

looks they've addressed in docs:

due express 4.x.x changes, need pass express-session function connect-redis exports in order extend express-session.store:

var session = require('express-session') , redisstore = require('connect-redis')(session);

app.use(session({ store: new redisstore(options), secret: 'keyboard cat' }))

https://github.com/visionmedia/connect-redis under usage


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -