diff options
Diffstat (limited to 'Services')
-rw-r--r-- | Services/IRobotsTxtGenerator.cs | 4 | ||||
-rw-r--r-- | Services/RobotsTxtGenerator.cs | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/Services/IRobotsTxtGenerator.cs b/Services/IRobotsTxtGenerator.cs index d989c8f..6f49924 100644 --- a/Services/IRobotsTxtGenerator.cs +++ b/Services/IRobotsTxtGenerator.cs @@ -1,6 +1,4 @@ -using System.Text; - -namespace MyDarling.Controllers; +namespace MyDarling.Services; public interface IRobotsTxtGenerator { diff --git a/Services/RobotsTxtGenerator.cs b/Services/RobotsTxtGenerator.cs new file mode 100644 index 0000000..26e5cee --- /dev/null +++ b/Services/RobotsTxtGenerator.cs @@ -0,0 +1,17 @@ +using System.Text; + +namespace MyDarling.Services; + +public class RobotsTxtGenerator : IRobotsTxtGenerator +{ + public string GetRobotsText() + { + StringBuilder stringBuilder = new(); + stringBuilder.AppendLine("user-agent: *"); + stringBuilder.AppendLine("Disallow: /freedom"); + stringBuilder.AppendLine("Disallow: /Account/"); + stringBuilder.AppendLine("Disallow: /account/"); + + return stringBuilder.ToString(); + } +} |