mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 23:16:47 +00:00
13 lines
243 B
TypeScript
13 lines
243 B
TypeScript
import Keyv from 'keyv'
|
|
|
|
import { isRedisEnabled, redisUrl, redisNamespace } from './config'
|
|
|
|
let db: Keyv
|
|
if (isRedisEnabled) {
|
|
db = new Keyv(redisUrl, { namespace: redisNamespace || undefined })
|
|
} else {
|
|
db = new Keyv()
|
|
}
|
|
|
|
export { db }
|