Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url shortener #2

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 14 additions & 0 deletions app/robots.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const loader = () => {
Copy link
Member

Choose a reason for hiding this comment

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

@SeanBlagsvedt can you confirm if this robots.txt looks right?

const robotText = `
User-agent: *
User-agent: AdsBot-Google
Disallow: /q/
`
// return the text content, a status 200 success response, and set the content type to text/plain
return new Response(robotText,{
status: 200,
headers: {
"Content-Type": "text/plain",
}
});
};
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions remix.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const proxyUrls = [
"/favicon.ico",
"/sitemap.xml/",
"/__/*",
"/2/*",
];

/** @type {import('@remix-run/dev').AppConfig} */
Expand Down Expand Up @@ -53,6 +54,7 @@ module.exports = {
route(path, "proxy.tsx", { id: path });
}
route("/__/realtime/*", "realtime.tsx");
route("/robots.txt", "robots.tsx");
route("*", "app.tsx");
});
},
Expand Down