diff options
| author | Factiven <[email protected]> | 2023-09-13 00:45:53 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-13 00:45:53 +0700 |
| commit | 7327a69b55a20b99b14ee0803d6cf5f8b88c45ef (patch) | |
| tree | cbcca777593a8cc4b0282e7d85a6fc51ba517e25 /lib/redis.js | |
| parent | Update issue templates (diff) | |
| download | moopa-7327a69b55a20b99b14ee0803d6cf5f8b88c45ef.tar.xz moopa-7327a69b55a20b99b14ee0803d6cf5f8b88c45ef.zip | |
Update v4 - Merge pre-push to main (#71)
* Create build-test.yml
* initial v4 commit
* update: github workflow
* update: push on branch
* Update .github/ISSUE_TEMPLATE/bug_report.md
* configuring next.config.js file
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; |