Skip to content

GET

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/web/src/app/p/[slugId]/pages/[slug]/route.ts

Same-origin markdown for one published page: /p//pages/.md

Every entry in llms.txt points at one of these, and until now every one of them 404'd into the SPA shell — an agent following our own discovery index received 25 KB of HTML with a 200 and a text/html content type, which is worse than a clean failure because nothing looks broken. The API served the markdown correctly the whole time; nothing on the published origin routed to it.

Proxied rather than redirected, for the same reason llms.txt is: an agent should never have to follow a hop to a different origin, and the API attributes the read to the real crawler.

Signature

ts
async function GET(req: Request, ctx: { params: Promise<{ slugId: string; slug: string }> })

Parameters

NameType
reqRequest
ctx{ params: Promise<{ slugId: string; slug: string }> }

Was this page helpful?

Download as PDF