From f544cd51df4c4718c7815946635234dbf56bcabd Mon Sep 17 00:00:00 2001 From: Naomi Chopra Date: Wed, 26 Mar 2025 10:56:12 +0530 Subject: [PATCH] add static search --- apps/www/app/api/search/route.ts | 7 +++++++ apps/www/app/layout.tsx | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 apps/www/app/api/search/route.ts diff --git a/apps/www/app/api/search/route.ts b/apps/www/app/api/search/route.ts new file mode 100644 index 0000000..8b88a8b --- /dev/null +++ b/apps/www/app/api/search/route.ts @@ -0,0 +1,7 @@ +import { source } from '@/lib/source'; +import { createFromSource } from 'fumadocs-core/search/server'; + +// it should be cached forever +export const revalidate = false; + +export const { staticGET: GET } = createFromSource(source); \ No newline at end of file diff --git a/apps/www/app/layout.tsx b/apps/www/app/layout.tsx index 1fa88ff..d20c43d 100644 --- a/apps/www/app/layout.tsx +++ b/apps/www/app/layout.tsx @@ -29,6 +29,11 @@ export default function Layout({ children }: { children: ReactNode }) {