brf/server/handlers/robots.ts
2025-11-24 17:09:09 +01:00

19 lines
319 B
TypeScript

import env from '../env.ts'
const CONTENT = {
development: `
User-agent: *
Disallow: /
`,
production: `
User-agent: *
Disallow: /admin
`,
}
const contents = (CONTENT[env.NODE_ENV] || CONTENT.development).trim()
export default function robots(_request, reply) {
return reply.type('text/plain').send(contents)
}