From 4d50bebcaf6d36f5d011ae90467f4b902617660f Mon Sep 17 00:00:00 2001 From: scosman Date: Sun, 28 Jul 2024 16:47:11 -0400 Subject: [PATCH] Missing API route, and pre-render search --- src/routes/(marketing)/search/+page.server.ts | 1 + src/routes/(marketing)/search/api/+server.ts | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/routes/(marketing)/search/+page.server.ts create mode 100644 src/routes/(marketing)/search/api/+server.ts diff --git a/src/routes/(marketing)/search/+page.server.ts b/src/routes/(marketing)/search/+page.server.ts new file mode 100644 index 00000000..176ae642 --- /dev/null +++ b/src/routes/(marketing)/search/+page.server.ts @@ -0,0 +1 @@ +export const prerender = true diff --git a/src/routes/(marketing)/search/api/+server.ts b/src/routes/(marketing)/search/api/+server.ts new file mode 100644 index 00000000..8a4426b8 --- /dev/null +++ b/src/routes/(marketing)/search/api/+server.ts @@ -0,0 +1,9 @@ +import { buildSearchIndex } from "$lib/build_index" + +export async function GET() { + console.log("Search API") + const searchData = await buildSearchIndex() + return new Response(JSON.stringify(searchData)) +} + +export const prerender = true