Skip to content

Commit

Permalink
support for redisStore({url})
Browse files Browse the repository at this point in the history
  • Loading branch information
davb committed Jun 7, 2017
1 parent b33719a commit d27dd8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Expand Up @@ -11,7 +11,13 @@ const redisStore = (...args) => {

redisCache = new Redis.Cluster(nodes, options || {});
} else {
redisCache = new Redis(...args);
if (typeof args === 'object' && typeof args.url === 'string') {
// connect by URL: redisStore({url: "redis://..."})
redisCache = new Redis(args.url);
} else {
// connect by params: redisStore({host, port, password...})
redisCache = new Redis(...args);
}
}

const storeArgs = redisCache.options;
Expand Down

0 comments on commit d27dd8b

Please sign in to comment.