From c1001f602a78d64228415aab1bed24d4f4e1dc7f Mon Sep 17 00:00:00 2001 From: mahanstreamer <84676642+mahanstreamer@users.noreply.github.com> Date: Sun, 5 Sep 2021 18:34:40 -0400 Subject: [PATCH] Add robots.txt file --- src/server/index.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)) || {}; -- 2.44.1