router icon indicating copy to clipboard operation
router copied to clipboard

way to dynamically get all defined routes?

Open columbian-chris opened this issue 3 years ago • 3 comments

Is there a method to get all of the routes that have been defined?

columbian-chris avatar Oct 07 '21 16:10 columbian-chris

Apparently no. You can either extend Bramus and inpmement a getter method yourself (getAfterRoutes or something), or you can make a pull request. Maybe you could add a specific usecase why this might be usefull :)

uvulpos avatar Oct 07 '21 17:10 uvulpos

The use case I see would be if you wanted to use an endpoint that lists all endpoints, like an API index.

columbian-chris avatar Oct 14 '21 20:10 columbian-chris

https://github.com/bramus/router/pull/163#issuecomment-968303768

uvulpos avatar Nov 15 '21 00:11 uvulpos