0
好日子伙计我有一个关于cookie会话即时通讯制作的问题。我想摆脱错误的内部服务器错误(Heroku控制台)
connect.session()MemoryStore的并非设计用于生产环境
所以我红论坛,说这是正常的,如果我想获得摆脱错误,然后使用connect-redis,是的它的工作原理,但问题是它打开我的应用程序时(不在控制台中)给我一个错误;
内部服务器错误
和我的控制台上其返回
return next(new Error('Oh no')) //handle error
这里是我到目前为止的代码:
app.set( '信任代理',1 );
app.use(session({
cookie:{
secure: true,
maxAge:60000
},
store: new RedisStore({host:'https://pektos6.herokuapp.com', port: port}),
secret: 'secret',
saveUninitialized: true,
resave: false
}));
app.use(function(req,res,next){
if(!req.session){
return next(new Error('Oh no')) //handle error
}
next() //otherwise continue
});