Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
if (process.env.APP_ENV === "production") {
return {
rules: [
{
userAgent: "Bytedance",
disallow: "/",
},
{
userAgent: "Bytespider",
disallow: "/",
},
{
userAgent: "GPTBot",
disallow: "/",
},
],
};
Comment on lines +5 to +20

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The production rules block specific bots but don't specify behavior for other crawlers. This means bots like Googlebot will have unrestricted access by default. Consider adding an explicit rule for '*' user agent with 'allow: /' to make the intent clear, or add 'allow' rules for the blocked bots if they should only be blocked from specific paths.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna ignore this to maintain the exact existing robots.txt

}

// No bot access for non-prod environments
return {
rules: {
userAgent: "*",
disallow: "/",
},
Comment on lines +25 to +28

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rules property should be an array to match the MetadataRoute.Robots type definition and maintain consistency with the production configuration. Change 'rules: {' to 'rules: [{' and close with '}]'.

Suggested change
rules: {
userAgent: "*",
disallow: "/",
},
rules: [
{
userAgent: "*",
disallow: "/",
},
],

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Robots type can be an array or single object, gonna ignore this

};
}
8 changes: 0 additions & 8 deletions public/robots.txt

This file was deleted.