New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print all routes #227
Comments
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. — -- |
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
|
I can't speak for others, but perhaps a method to return an array of structs containing the method & original pattern? --edit |
Yeah. I think that is a good idea. The Routes middleware should be able to On Mon, Apr 14, 2014 at 8:58 AM, Harley Laue notifications@github.comwrote:
|
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
The text was updated successfully, but these errors were encountered: