mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-17 05:40:42 -07:00
21 lines
520 B
TypeScript
21 lines
520 B
TypeScript
import { notFound } from 'next/navigation';
|
|
import { getLLMText, source } from '@/lib/source';
|
|
|
|
export const revalidate = false;
|
|
|
|
export async function GET(_req: Request, { params }: RouteContext<'/llms.mdx/docs/[[...slug]]'>) {
|
|
const { slug } = await params;
|
|
const page = source.getPage(slug);
|
|
if (!page) notFound();
|
|
|
|
return new Response(await getLLMText(page), {
|
|
headers: {
|
|
'Content-Type': 'text/markdown',
|
|
},
|
|
});
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.generateParams();
|
|
}
|