Skip to content

Commit cdec20a

Browse files
fix: runtime config in server api route
1 parent 18a23a8 commit cdec20a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/server/api/kql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import type { KqlQueryRequest, KqlQueryResponse } from '../../types'
44
import { getAuthHeaders } from '../../utils'
55
import { useRuntimeConfig } from '#app'
66

7-
const { kql } = useRuntimeConfig()
8-
97
export default defineEventHandler(async (event): Promise<KqlQueryResponse> => {
108
assertMethod(event, 'POST')
119
const body = await useBody(event)
@@ -20,6 +18,8 @@ export default defineEventHandler(async (event): Promise<KqlQueryResponse> => {
2018
}
2119
}
2220

21+
const { kql } = useRuntimeConfig()
22+
2323
try {
2424
return await $fetch<KqlQueryResponse>(kql.kirbyEndpoint, {
2525
baseURL: kql.kirbyUrl,

0 commit comments

Comments
 (0)