Sequence NODE_219
EasyCreate a robots.txt Route
Next.js
JavaScript
Technical Specification
Create a route that returns a robots.txt response for your site.
Input/Output Samples
Input:/robots.txt
Output:User-agent: *
Optimal Logic Path
// app/robots.txt/route.ts
export function GET() {
const text = `User-agent: *
Allow: /`;
return new Response(text, {
headers: { "Content-Type": "text/plain" },
});
}Architectural Deep-Dive
robots.txt tells crawlers which parts of your site they can crawl.