nany serve robots.txt file
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user