nany serve robots.txt file

This commit is contained in:
Tommy
2015-02-16 14:55:43 -05:00
parent cd0ff001c2
commit 69dc012dc7
3 changed files with 1 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ namespace AboutMe.Web.AppStart
conventions.StaticContentsConventions.AddDirectory("Images");
conventions.StaticContentsConventions.AddDirectory("Scripts");
conventions.StaticContentsConventions.AddDirectory("fonts");
conventions.StaticContentsConventions.AddFile("/robots.txt",System.IO.Path.Combine("Content", "robots.txt"));
}
}
}

View File

@@ -11,19 +11,6 @@ namespace AboutMe.Web.Modules
public Index()
{
Get["/"] = x => View["Index"];
Get["robots.txt"] = x =>
{
var res = this.Response.AsFile("robots.txt", "text/plain");
res.Contents = a =>
{
var msg = new StreamWriter(a);
msg.Write(new StringBuilder().AppendLine("User-agent: *"));
msg.Flush();
msg.Dispose();
};
return res;
};
}
}
}