diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 12:47:15 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-08-06 12:57:19 +0100 |
| commit | 5091b1bf0501d08bb5af90eb75a0833d7d9aba3e (patch) | |
| tree | 844dd4740092b38a0168e56944d33a9e3301d32d /app/config | |
Initial commit
Diffstat (limited to 'app/config')
| -rw-r--r-- | app/config/redis.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/config/redis.ts b/app/config/redis.ts new file mode 100644 index 0000000..02302da --- /dev/null +++ b/app/config/redis.ts @@ -0,0 +1,13 @@ +import { createClient } from 'redis'; + +export type RedisClientConnection = ReturnType<typeof createClient> + +export const connectRedis = async (): Promise<RedisClientConnection> => { + const redisClient = createClient({ url: process.env.REDIS_URI }); + await redisClient.connect(); + + return redisClient; +} + +export default connectRedis; + |
