private Request ConvertPathToNancyRequest(string pagePath)
{
//the result will be pages/test.cshtml
string basePath = Path.Combine(_basePath, _configuration.PagesPath);
string relativeUrl = pagePath.Replace(basePath, "").Replace(@"\", @"/").TrimStart('/');
if (relativeUrl.LastIndexOf('.') > 0)
relativeUrl = relativeUrl.Substring(0, relativeUrl.LastIndexOf('.'));
return new Request(
"GET",
string.Concat("/", relativeUrl),
"http");
}