From b83deea70a9fc48854885fb04d49ee6577d21388 Mon Sep 17 00:00:00 2001 From: Guido X Jansen Date: Wed, 27 Nov 2024 01:41:11 +0100 Subject: [PATCH] API Route handler --- src/pages/api/keystatic/[...params].ts | 6 ++++++ src/pages/keystatic/index.astro | 26 ++------------------------ 2 files changed, 8 insertions(+), 24 deletions(-) create mode 100644 src/pages/api/keystatic/[...params].ts diff --git a/src/pages/api/keystatic/[...params].ts b/src/pages/api/keystatic/[...params].ts new file mode 100644 index 0000000..56d1f54 --- /dev/null +++ b/src/pages/api/keystatic/[...params].ts @@ -0,0 +1,6 @@ +import { makeHandler } from '@keystatic/astro/api'; +import keystaticConfig from '../../../../keystatic.config'; + +export const all = makeHandler({ + config: keystaticConfig, +}); diff --git a/src/pages/keystatic/index.astro b/src/pages/keystatic/index.astro index 06dda98..68537ba 100644 --- a/src/pages/keystatic/index.astro +++ b/src/pages/keystatic/index.astro @@ -1,28 +1,6 @@ --- -import { Keystatic } from '@keystatic/core/ui'; -import type { Config } from '@keystatic/core'; +import { keystatic } from '@keystatic/astro'; import config from '../../../keystatic.config'; - -const keystaticConfig = config as Config; --- - - - - - - Admin | CommerceQuest - - - -
- -
- - +{keystatic({ config })}