diff --git a/docs/src/app/llms-full.txt/route.ts b/docs/src/app/llms-full.txt/route.ts new file mode 100644 index 000000000..aec6a2009 --- /dev/null +++ b/docs/src/app/llms-full.txt/route.ts @@ -0,0 +1,15 @@ +import { getLLMText } from '../../../lib/get-llm-text'; +import { apiSource, source } from '../../../lib/source'; + +export const revalidate = false; + +export async function GET() { + const pages = [...source.getPages(), ...apiSource.getPages()]; + const texts = await Promise.all(pages.map(getLLMText)); + + return new Response(texts.join('\n\n'), { + headers: { + 'Content-Type': 'text/plain; charset=utf-8', + }, + }); +}