]> Untitled Git - lemmy-ui.git/commitdiff
Add robots.txt file
authormahanstreamer <84676642+mahanstreamer@users.noreply.github.com>
Sun, 5 Sep 2021 22:34:40 +0000 (18:34 -0400)
committerGitHub <noreply@github.com>
Sun, 5 Sep 2021 22:34:40 +0000 (18:34 -0400)
src/server/index.tsx

index c95e44af29c8ea2aabddea3ef2ffd4cbeb894419..58a9691dd2d49617f67c6db417f60a2ac20b8315 100644 (file)
@@ -28,7 +28,20 @@ server.use(express.json());
 server.use(express.urlencoded({ extended: false }));
 server.use("/static", express.static(path.resolve("./dist")));
 
+const robotstxt =
+`User-Agent: *
+Disallow: /login
+Disallow: /settings
+Disallow: /create_community
+Disallow: /create_post
+Disallow: /inbox
+Disallow: /search/
+`;
 // server.use(cookieParser());
+server.get("/robots.txt", async (req, res) => {
+  res.setHeader("content-type","text/plain; charset=utf-8") 
+  res.send(robotstxt)
+});
 
 server.get("/*", async (req, res) => {
   const activeRoute = routes.find(route => matchPath(req.path, route)) || {};