Skip to content
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

How to get all routes registered at runtime? #569

Closed
xpbliss opened this issue Mar 27, 2016 · 5 comments
Closed

How to get all routes registered at runtime? #569

xpbliss opened this issue Mar 27, 2016 · 5 comments

Comments

@xpbliss
Copy link

xpbliss commented Mar 27, 2016

How to get all routes registered at runtime?

@widnyana
Copy link

first, I will define all the route, then register all defined route, with this route registration func

did you look for something like that, @xpbliss ?

@xpbliss
Copy link
Author

xpbliss commented Mar 28, 2016

good!

@javierprovecho
Copy link
Member

@widnyana thank you!

@xpbliss reopen if you had any more questions about this.

@adrian-moisa
Copy link

Any answer for this question?

@abrar71
Copy link

abrar71 commented May 31, 2023

You can all the routes using router.Routes() and loop through the array to get .Method and .Path of each registered route

for _, item := range router.Routes() {
	println("method:", item.Method, "path:", item.Path)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants