mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-06 04:19:20 +00:00
* feat: add LLM copy button and view options components - update routing for LLM text generation, adding .mdx to a route now generates its .md repsresentation - add rewrite from /docs/:path*mdx to /llms.txt/:path so ai can traverse the llms.txt as routes * chore: lint * chore: cubic
22 lines
568 B
TypeScript
22 lines
568 B
TypeScript
import { type NextRequest, NextResponse } from "next/server";
|
|
import { source } from "@/lib/source";
|
|
import { notFound } from "next/navigation";
|
|
import { getLLMText } from "@/app/docs/lib/get-llm-text";
|
|
|
|
export const revalidate = false;
|
|
|
|
export async function GET(
|
|
_req: NextRequest,
|
|
{ params }: { params: Promise<{ slug: string[] }> },
|
|
) {
|
|
const slug = (await params).slug;
|
|
const page = source.getPage(slug);
|
|
if (!page) notFound();
|
|
|
|
return new NextResponse(await getLLMText(page));
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.generateParams();
|
|
}
|