1、express-session deprecated undefined resave option; provide resave option app.js:49:9
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option app.js:49:9
解答:其实我们可以看到红色的部分就是导致错误的原因;解决办法:
app.use(session({ secret: ‘keyboard cat‘, cookie: { maxAge: 60000 }, resave: true, saveUninitialized: true }))具体参看
https://github.com/expressjs/session#options2、failed to load c++ bson extension using pure js version在package.json修改 “connect-mongo”:“0.8.2” 运行npm install安装模块,打开app.js,添加以下代码:
app.use(session({ secret: settings.cookieSecret, key: settings.db,//cookie name cookie: {maxAge: 1000 * 60 * 60 * 24 * 30},//30 days store: new MongoStore({ db: settings.db, host: settings.host, port: settings.port, url: ‘mongodb://localhost/myblog‘ }), proxy: true, resave: true, saveUninitialized: true
时间: 2024-10-08 09:48:12