summaryrefslogtreecommitdiff
path: root/Services
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-06-14 07:45:14 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-06-14 07:45:14 +0300
commita5bf29c00b85358f5cc078422871aa6654866d0c (patch)
tree177c69399bb1b1ae680265f5c0dedbdbf8305587 /Services
parentafdaabce8fb24f6fd46e387445c076f67a0c98ed (diff)
Add robots.txt generator
Diffstat (limited to 'Services')
-rw-r--r--Services/IRobotsTxtGenerator.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Services/IRobotsTxtGenerator.cs b/Services/IRobotsTxtGenerator.cs
new file mode 100644
index 0000000..a238a8e
--- /dev/null
+++ b/Services/IRobotsTxtGenerator.cs
@@ -0,0 +1,21 @@
+using System.Text;
+
+namespace MyDarling.Controllers;
+
+public interface IRobotsTxtGenerator
+{
+ public string GetRobotsText();
+}
+
+public class RobotsTxtGenerator : IRobotsTxtGenerator
+{
+ public string GetRobotsText()
+ {
+ StringBuilder stringBuilder = new();
+ stringBuilder.AppendLine("user-agent: *");
+ stringBuilder.AppendLine("disallow: /freedom");
+ stringBuilder.AppendLine("disallow: /Account/");
+
+ return stringBuilder.ToString();
+ }
+}