jacksonh / manos

Manos is an easy to use, easy to test, high performance web application framework that stays out of your way and makes your life ridiculously simple.
Other
455 stars 61 forks source link

manos documentation broken. #115

Open MarkKharitonov opened 13 years ago

MarkKharitonov commented 13 years ago

First of all, the index page is not available at http://localhost:8181/ as the output suggests, but rather at http://localhost:8181/Index

But even when the index page shows, all the links there are broken.

This makes it really hard to start using manos and that's a shame, because its manifesto is very inspirational.

MarkKharitonov commented 13 years ago

OK, it seems that the default MatchType of RouteAttribute was changed from Simple to String. Once I added explicit MatchType.Simple to DocsModule.Manual and DocsModule.Tutorial methods the routing worked, but tutorial pages where still not found.

The reason for that failure is that DocsModule.WriteMarkdownDocsPage was passed the page parameter, which is "page-1.md", whereas the actual path should be "Tutorial/page-1.md". So, instead of:

[Route("/Tutorial/{page}")]
public void Tutorial(IManosContext ctx, string page)
{
  WriteMarkdownDocsPage(ctx.Response, page);
}

We should have:

[Route("/Tutorial/{page}", MatchType = MatchType.Simple)]
public void Tutorial(IManosContext ctx, string page)
{
  WriteMarkdownDocsPage(ctx.Response, ctx.Request.Path.TrimStart('/'));
}

Now I can view the manual and the tutorial.