Skip to content

Commit 6c5ae24

Browse files
committed
Updated README.md
1 parent f2577c9 commit 6c5ae24

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Fastify Redis connection plugin, with this you can share the same Redis connection in every part of your server.
66

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 [ioredis](https://github.com/luin/ioredis) is used as client, the ``options`` that you pass to `register` will be passed to the Redis client.
88

99
## Install
1010
```
@@ -14,18 +14,10 @@ npm i fastify-redis --save
1414
Add it to your project with `register` and you are done!
1515
You can access the *Redis* client via `fastify.redis`.
1616

17-
If needed, you can pass a custom ``driver`` option, such as [ioredis](https://github.com/luin/ioredis). By default the official [redis](https://github.com/NodeRedis/node_redis) client is used.
18-
19-
2017
```js
2118
const fastify = require('fastify')
2219

23-
fastify.register(require('fastify-redis'), {
24-
driver: require('ioredis'),
25-
host: '127.0.0.1'
26-
}, err => {
27-
if (err) throw err
28-
})
20+
fastify.register(require('fastify-redis'), { host: '127.0.0.1' })
2921

3022
fastify.get('/foo', (req, reply) => {
3123
const { redis } = fastify
@@ -52,9 +44,9 @@ object with the `client` property set to the instance.
5244

5345
```js
5446
const fastify = Fastify()
55-
const redis = require('redis').createClient({host: 'localhost', port: 6379})
47+
const redis = require('redis').createClient({ host: 'localhost', port: 6379 })
5648

57-
fastify.register(fastifyRedis, {client: redis})
49+
fastify.register(fastifyRedis, { client: redis })
5850

5951
// ...
6052
// ...

0 commit comments

Comments
 (0)