You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,26 @@
4
4
5
5
Fastify Redis connection plugin, with this you can share the same Redis connection in every part of your server.
6
6
7
-
Under the hood the official [redis](https://github.com/NodeRedis/node_redis) client is used, the options that you pass to `register` will be passed to the Redis client.
7
+
Under the hood the official [redis](https://github.com/NodeRedis/node_redis) client is used, the ``options`` that you pass to `register` which the ``redis`` option will be passed to the Redis client.
8
8
9
9
## Install
10
10
```
11
11
npm i fastify-redis --save
12
12
```
13
13
## Usage
14
-
Add it to you project with `register` and you are done!
14
+
Add it to you project with `register` and you are done!
15
15
You can access the *Redis* client via `fastify.redis`.
16
+
17
+
And you can custom your own redis client, use ``driver`` option, now only support [ioredis](https://github.com/luin/ioredis) client, default is [redis](https://github.com/NodeRedis/node_redis).
18
+
16
19
```js
17
20
constfastify=require('fastify')
18
21
19
22
fastify.register(require('fastify-redis'), {
20
-
host:'127.0.0.1'
23
+
driver:require('ioredis'), // when you custom your redis client. optional
0 commit comments