app.use(express.session({
secret: settings.cookie_secret,
store: new MongoStore({
db: settings.db
})
}));
在本地测试,这个 settting.db设置成 数据库名字 比如test是可以通过的,但是放到vps,vps上的数据库一个完整的连接串,写完整了提示
^
Error: database names cannot contain the character '.'
回复 (1)
Y
折腾了一上午 禁了MemoryStore就可以了 原来是vps不能用这货
Warning: connection.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
Express server listening on port 8080
参与回复
登录后即可参与回复。登录