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

Route introspection? #882

Open
yaleman opened this issue Apr 12, 2022 · 2 comments
Open

Route introspection? #882

yaleman opened this issue Apr 12, 2022 · 2 comments

Comments

@yaleman
Copy link

yaleman commented Apr 12, 2022

Is there a way to do this - I'd like to be able to do something similar to #101 and pull information from the server as built, but I can't find any interface to do so?

@jbr
Copy link
Member

jbr commented Apr 12, 2022

This is not currently possible, but is closer to possible on main than the latest release. You'd need to iterate over the routefinder routers, which are not currently publicly exposed

@pictographer
Copy link

In my project, I'm defining routes in a TOML file along with documentation, error messages, and parameter types.

As a workaround for lack of access to the route finder's internal state, I configure Tide with the minimum number of catch-all routes and then will use the routefinder crate myself. It's a bit redundant because each route is parsed twice, but Tide's parsing is just a minimal wildcard.

I've gotta' say, Tide is pretty great for how few lines of code it is.

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

3 participants