Replies: 1 comment 2 replies
-
Hello, The Router generally needs work and was put together fairly quickly just to get the job done. This is a good discussion to have now since I've been meaning to come around and get some work done on the Router/Routes.
The general goal is to add features while minimizing the performance impact from having better ergonomics. If you want to work on something, feel free to and I'll do my best to answer any questions you have! I'm likely going to take a look at this stuff pretty soon. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm currently discovering zzz and tardy and I love these! I have improvements suggestions about the router, and I would like to read your thoughts about them to know how I could contribute.
serve_error
, which could allow users to define a custom renderer for errors in handlers, but also routing./api
which renders errors as JSON, and an error handler for the rest which renders errors as HTML.TokenMatch
implementation would be to allow regex instead of relying on types parsing. If you expect an integer, instead of using"%d"
, you'd write something like":param([0-9]+)"
(my inspiration for this comes from Flight for PHP). All captures would then be strings and the conversion (in case of an integer) must be made by users, but I don't think it's a problem...For these last two points, it can also be answered this way: do you want zzz to provide a tiny simple router and let more complex tasks for third-party routers, or you want zzz to provide a full-featured router?
I'd be happy to open issues / pull requests with your wishes about the future router features, let me know! :-)
Beta Was this translation helpful? Give feedback.
All reactions