Express 500 Error: `secret` option required for sessions
app.js下
app.configure(function () {
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
app.use(express.session({
secret: settings.cookiesSecret,
store: new MongoStore({
db: settings.db
})
}))
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});
setting.js下:
module.exports = {
cookieSecret: 'microblogbyvoid',
db: 'microblog',
host: 'localhost'
};
求帮助啊。。。。哪里有错啊。。。。。《node.js开发指南 》注册一章的例子呀