Print all routes
skolos opened this issue · 7 comments
For debugging purposes I'd like to print all routes. This is especially should be useful when Groups are used. I could not locate this functionality anywhere in the code. Maybe I am missing something obvious.
Thanks
Add this after that line: https://github.com/go-martini/martini/blob/master/router.go#L140
fmt.Println(pattern)
Not everyone might want all routes to be printed when they’re not in production. Let’s see what @codegangsta thinks about this.
On 14 de abril de 2014 at 17:08:51, Harley Laue (notifications@github.com) wrote:
This might be a good one-off solution. IMO a better solution might be to print that whenever the environment is != production.
—
Reply to this email directly or view it on GitHub.
--
José M. Molina
Sent with Airmail
You're right. I will say though, I did like that Dropwizard printed the routes upon starting (I don't recall if they do that unconditionally though.) Rails also has a utility to print all routes as well IIRC. So it's not an uncommon feature and can be quite valuable to verify your routes.
I can see Martini enabling this kind of behavior via extension. That way it is an opt in rather than a feature forced on users. What does the API need in order to print routes?
Sent from my iPhone
On Apr 14, 2014, at 8:32 AM, Harley Laue notifications@github.com wrote:
You're right. I will say though, I did like that Dropwizard printed the routes upon starting (I don't recall if they do that unconditionally though.) Rails also has a utility to print all routes as well IIRC. So it's not an uncommon feature and can be quite valuable to verify your routes.
—
Reply to this email directly or view it on GitHub.
I can't speak for others, but perhaps a method to return an array of structs containing the method & original pattern?
--edit
This is potentially unfortunate because it would have to flatten groups as well.
Yeah. I think that is a good idea. The Routes middleware should be able to
support something like that
On Mon, Apr 14, 2014 at 8:58 AM, Harley Laue notifications@github.comwrote:
I can't speak for others, but perhaps a method to return an array of
structs containing the method & original pattern?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/227#issuecomment-40383594
.