Skip to content

Commit 3ab3dca

Browse files
authored
Merge pull request #1 from martinzuern/redis-options
Redis options
2 parents ab5c3a2 + 8d9c7d6 commit 3ab3dca

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ var SecureStore = require('secure-store-redis');
99
var store = new SecureStore({
1010
namespace: 'myApp:store',
1111
secret: 'quacks like a duck',
12-
redis: { // standard redis config object
13-
host: "127.0.0.1",
14-
port: 6379
15-
}
12+
redis: {
13+
host: 'localhost', // optional
14+
port: 6379, // optional
15+
max_clients: 30, // optional
16+
database: 0, // optional
17+
options: {
18+
auth_pass: 'password'
19+
} //options for createClient of node-redis, optional
20+
}
1621
});
1722

1823
store.save('quote', 'i see dead people', function (err, reply) {

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ function SecureStore(cfg) {
1919

2020
this.pool = RCP(this.namespace, {
2121
host: cfg.redis.host || 'localhost',
22-
port: cfg.redis.port || 6379
22+
port: cfg.redis.port || 6379,
23+
max_clients: cfg.redis.max_clients || 30,
24+
database: cfg.redis.database || 0,
25+
options: cfg.redis.options || null
2326
});
2427
}
2528

0 commit comments

Comments
 (0)