From: mahanstreamer <84676642+mahanstreamer@users.noreply.github.com> Date: Sun, 5 Sep 2021 22:34:40 +0000 (-0400) Subject: Add robots.txt file X-Git-Url: http://these/git/%22https:/nerdica.net/%7B%24%7B%60data:application/manifest%20json;base64%2C%24%7Bawait?a=commitdiff_plain;h=c1001f602a78d64228415aab1bed24d4f4e1dc7f;p=lemmy-ui.git Add robots.txt file --- diff --git a/src/server/index.tsx b/src/server/index.tsx index c95e44a..58a9691 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -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)) || {};