Add robots.txt file
This commit is contained in:
parent
6091f07d20
commit
c1001f602a
1 changed files with 13 additions and 0 deletions
|
@ -28,7 +28,20 @@ server.use(express.json());
|
||||||
server.use(express.urlencoded({ extended: false }));
|
server.use(express.urlencoded({ extended: false }));
|
||||||
server.use("/static", express.static(path.resolve("./dist")));
|
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.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) => {
|
server.get("/*", async (req, res) => {
|
||||||
const activeRoute = routes.find(route => matchPath(req.path, route)) || {};
|
const activeRoute = routes.find(route => matchPath(req.path, route)) || {};
|
||||||
|
|
Loading…
Reference in a new issue