diff options
| author | Factiven <[email protected]> | 2023-09-12 21:45:30 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-09-12 21:45:30 +0700 |
| commit | 701798acaeb28f657bd1420d06253d350eb41b96 (patch) | |
| tree | 6df53eb6c7ae07c5af21bcd6d3a0078b1d196d13 /lib/redis.js | |
| parent | Create build-test.yml (diff) | |
| download | moopa-701798acaeb28f657bd1420d06253d350eb41b96.tar.xz moopa-701798acaeb28f657bd1420d06253d350eb41b96.zip | |
initial v4 commit
Diffstat (limited to 'lib/redis.js')
| -rw-r--r-- | lib/redis.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/redis.js b/lib/redis.js new file mode 100644 index 0000000..ed8b8c5 --- /dev/null +++ b/lib/redis.js @@ -0,0 +1,13 @@ +import { Redis } from "ioredis"; + +const REDIS_URL = process.env.REDIS_URL; + +let redis; + +if (REDIS_URL) { + redis = new Redis(REDIS_URL); +} else { + console.warn("REDIS_URL is not defined. Redis caching will be disabled."); +} + +export default redis; |