mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-13 15:09:47 +00:00
docs
This commit is contained in:
@@ -94,6 +94,8 @@ export const includeNotionIdInUrls: boolean = getSiteConfig(
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Optional redis instance for persisting preview images
|
||||
export const isRedisEnabled: boolean = getSiteConfig('isRedisEnabled', false)
|
||||
|
||||
// (if you want to enable redis, only REDIS_HOST and REDIS_PASSWORD are required)
|
||||
// we recommend that you store these in a local `.env` file
|
||||
export const redisHost: string | null = getEnv('REDIS_HOST', null)
|
||||
|
||||
10
lib/db.ts
10
lib/db.ts
@@ -1,14 +1,12 @@
|
||||
import Keyv from 'keyv'
|
||||
|
||||
import {
|
||||
isPreviewImageSupportEnabled,
|
||||
redisUrl,
|
||||
redisNamespace
|
||||
} from './config'
|
||||
import { isRedisEnabled, redisUrl, redisNamespace } from './config'
|
||||
|
||||
let db: Keyv
|
||||
if (isPreviewImageSupportEnabled) {
|
||||
if (isRedisEnabled) {
|
||||
db = new Keyv(redisUrl, { namespace: redisNamespace || undefined })
|
||||
} else {
|
||||
db = new Keyv()
|
||||
}
|
||||
|
||||
export { db }
|
||||
|
||||
Reference in New Issue
Block a user