I'm implementing an API via a web service, using Nancy.
I'd like to have a /help or /docs page that programmatically lists all of the available routes, so that I can provide API users with automatically generated/updated documentation.
Any ideas on how to accomplish this? (Inside a route handler, "this.routes" gives access to a collection of defined routes - but only on the current NancyModule. I'd need a programmatic way to list all registered routes, not just ones in the current module)
You can do it by taking a dependency on the IRouteCacheProvider and calling GetCache - we actually do this in one of our demos in the main repo:
https://github.com/NancyFx/Nancy/blob/master/src/Nancy.Demo.Hosting.Aspnet/MainModule.cs#L13