提交 d8a089a25d80c995e58310b9b94d9f26e4b14d8c
1 个父辈
2573b1ca
Allowing not requiring redis
I know this is not a big deal and redis will be necessary and required most times. It turns out I'm working on a very simple app that doesn't require users, auth, thus redis is really not necessary.
正在显示
1 个修改的文件
包含
5 行增加
和
0 行删除
@@ -6,6 +6,11 @@ var RedisStore = require('connect-redis')(session) | @@ -6,6 +6,11 @@ var RedisStore = require('connect-redis')(session) | ||
6 | 6 | ||
7 | exports = module.exports = function(logger, settings) { | 7 | exports = module.exports = function(logger, settings) { |
8 | 8 | ||
9 | + // Allow not needing redis | ||
10 | + if (!settings.redis) { | ||
11 | + return false | ||
12 | + } | ||
13 | + | ||
9 | var connection = new RedisStore(settings.redis) | 14 | var connection = new RedisStore(settings.redis) |
10 | 15 | ||
11 | connection.on('error', function(err) { | 16 | connection.on('error', function(err) { |
请
注册
或
登录
后发表评论