tide icon indicating copy to clipboard operation
tide copied to clipboard

Route introspection?

Open yaleman opened this issue 3 years ago • 2 comments

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?

yaleman avatar Apr 12 '22 01:04 yaleman

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

jbr avatar Apr 12 '22 02:04 jbr

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.

pictographer avatar May 27 '22 15:05 pictographer