Skip to content

Commit

Permalink
Generate robots.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcginnes committed Feb 5, 2024
1 parent 519fac4 commit 435ca8e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type MetadataRoute } from "next"
import { env } from "~/env"

export default function robots(): MetadataRoute.Robots {
const baseUrl = env.SITE_URL ?? "http://localhost:3000"
return {
rules: {
userAgent: "*",
allow: "/",
disallow: "/private/",
},
sitemap: baseUrl + "/sitemap.xml",
}
}

0 comments on commit 435ca8e

Please sign in to comment.