Skip to content

Commit 6dac378

Browse files
feat: add robots.txt (#335)
1 parent 0aa0498 commit 6dac378

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

apps/blog-bff/src/main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ app.route('/authors', authors);
1616
app.route('/newsletter', newsletter);
1717
app.route('/banners', banners);
1818

19+
app.get('/robots.txt', (c) => {
20+
const robotsTxt = `User-agent: *
21+
Disallow: /`;
22+
return c.text(robotsTxt, 200, {
23+
'Content-Type': 'text/plain',
24+
});
25+
});
26+
1927
app.onError((err, c) => {
2028
console.error(err);
2129
if (err instanceof HTTPException) {

apps/blog/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"assets": [
2626
"apps/blog/src/assets",
2727
"apps/blog/src/sitemap.xml",
28-
"apps/blog/src/_redirects"
28+
"apps/blog/src/_redirects",
29+
"apps/blog/src/robots.txt"
2930
],
3031
"styles": [
3132
"apps/blog/src/styles.scss",

apps/blog/src/robots.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Host: staging.angular.love
5+
User-agent: *
6+
Disallow: /
7+
8+
Host: testing.angular.love
9+
User-agent: *
10+
Disallow: /
11+
12+
Host: bff.angular.love
13+
User-agent: *
14+
Disallow: /

0 commit comments

Comments
 (0)