Initial export from WebStudio.is
This commit is contained in:
24
app/routes/[robots.txt].tsx
Normal file
24
app/routes/[robots.txt].tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { LoaderFunctionArgs } from "react-router";
|
||||
|
||||
export const loader = (arg: LoaderFunctionArgs) => {
|
||||
const host =
|
||||
arg.request.headers.get("x-forwarded-host") ||
|
||||
arg.request.headers.get("host") ||
|
||||
"";
|
||||
|
||||
return new Response(
|
||||
`
|
||||
User-agent: *
|
||||
Disallow: /api/
|
||||
|
||||
Sitemap: https://${host}/sitemap.xml
|
||||
|
||||
`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "text/plain",
|
||||
},
|
||||
status: 200,
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user