egg-session-mongo
A session extension for store session in MongoDB.
see Chinese version: 中文
Install
$ npm i egg-session-mongo --save
Usage
exports.sessionMongo = {
enable: true,
package: 'egg-session-mongo',
};
or you can overwrite you MongoStore
options in app.js
.
module.exports = app => {
const MongoStore = require('egg-session-mongo')(app);
app.beforeStart(async () => {
app.sessionStore = new MongStore();
});
};
see app.js for more detail.
Configuration
exports.sessionMongo = {
url: 'mongodb://127.0.0.1/test'
};
see config/config.example.js for more detail.
Questions & Suggestions
Please open an issue here.
or open an issue just at this repo's issue for more timely reply
License
MIT