diff options
Diffstat (limited to 'src/app/api/search/route.ts')
| -rw-r--r-- | src/app/api/search/route.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/app/api/search/route.ts b/src/app/api/search/route.ts new file mode 100644 index 0000000..3c99f5c --- /dev/null +++ b/src/app/api/search/route.ts @@ -0,0 +1,11 @@ +import { getPosts } from '@/lib/source'; +import { createSearchAPI } from 'fumadocs-core/search/server'; + +export const { GET } = createSearchAPI('advanced', { + indexes: getPosts().map((page) => ({ + title: page.data.title, + structuredData: page.data.structuredData, + id: page.url, + url: page.url, + })), +}); |
