diff options
Diffstat (limited to 'Services/IRobotsTxtGenerator.cs')
-rw-r--r-- | Services/IRobotsTxtGenerator.cs | 21 |
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(); + } +} |