Connection strategy not found at MongoStore
发布于 12 天前 作者 fnf1993 304 次浏览 来自 问答

使用express-session和connect-mongo模块报错 源代码: var session = require(“express-session”); var MongoStore = require(“connect-mongo”)(session); 。。。 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 }) }));

回到顶部