svrjs-nextjs-website/app/api/search/route.ts

12 lines
317 B
TypeScript
Raw Normal View History

2024-06-24 10:02:18 +02:00
import { getPages } from "@/app/source";
import { createSearchAPI } from "fumadocs-core/search/server";
export const { GET } = createSearchAPI("advanced", {
indexes: getPages().map((page) => ({
title: page.data.title,
structuredData: page.data.exports.structuredData,
id: page.url,
url: page.url,
})),
});