mirror of
https://github.com/dathere/ckanaction.git
synced 2025-12-19 00:39:25 +00:00
24 lines
559 B
TypeScript
24 lines
559 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { getLLMText } from "@/lib/get-llm-text";
|
|
import { source } from "@/lib/source";
|
|
|
|
export const revalidate = false;
|
|
|
|
export async function GET(
|
|
_req: Request,
|
|
{ params }: RouteContext<"/llms.mdx/[[...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();
|
|
}
|