chore: verified production build and all checks pass
This commit is contained in:
+8
-4
@@ -8,13 +8,17 @@ import {
|
|||||||
} from '@directus/sdk'
|
} from '@directus/sdk'
|
||||||
import type { Article, Category, SiteSettings } from './types'
|
import type { Article, Category, SiteSettings } from './types'
|
||||||
|
|
||||||
let _client: ReturnType<typeof createDirectus> | null = null
|
function createClient() {
|
||||||
|
return createDirectus(process.env.DIRECTUS_URL!)
|
||||||
|
.with(staticToken(process.env.DIRECTUS_TOKEN!))
|
||||||
|
.with(rest())
|
||||||
|
}
|
||||||
|
|
||||||
|
let _client: ReturnType<typeof createClient> | null = null
|
||||||
|
|
||||||
function getClient() {
|
function getClient() {
|
||||||
if (!_client) {
|
if (!_client) {
|
||||||
_client = createDirectus(process.env.DIRECTUS_URL!)
|
_client = createClient()
|
||||||
.with(staticToken(process.env.DIRECTUS_TOKEN!))
|
|
||||||
.with(rest())
|
|
||||||
}
|
}
|
||||||
return _client
|
return _client
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user