Questions/Feedback after using this crate for Cloudflare Internship Hiring Assignment #96
Replies: 3 comments
-
Hi @abhishekc-sharma - Thanks for the thoughtful note, and for applying to Cloudflare's internship program! One of our interns @leoorshansky helped a TON on this project, maybe you can too :)
We should probably re-visit the decision to use To answer your question though, I would write a utility function that returns I would be happy to consider any suggestions you have here! It's hard to cover everything when designing a framework like this -- and knowing when not to add features is just as important. We want to be generally useful, without imposing too many patterns on users who have varying use-cases.
Yea, this is a great point. It's definitely something we should include support for. If you have any ideas on how you'd like to use it, it would be helpful to start with some design ideas. I would think that this would likely need to be done at the let mut router = Router::new();
router.add(check_auth);
router.add(cors);
... where Please feel free to leave notes / ideas here, and join us on Discord: https://discord.com/invite/cloudflaredev in the |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for you detailed response @nilslice . Yeah, I was thinking of a router API something along those lines. I'm most familiar with the Router interface of the Go library Gorilla. Have to explore further to see how the other backend frameworks in Rust do the same thing. |
Beta Was this translation helpful? Give feedback.
-
@abhishekc-sharma - I've converted your original issue to a Discussion, so we can carry forward more ideas/thoughts in a better format. Hope that's ok! |
Beta Was this translation helpful? Give feedback.
-
Hi,
In the last week I applied to and attempted the Cloudflare Internship Hiring Assignment https://apply.cloudflareworkers.com/ with this crate. I would say I completed a majority of it but at some point I was too unsatisfied with how my code looked so I switched to using JavaScript for my worker. I had some general questions about what the expected/idiomatic way of doing certain things were for which I couldn't find any documentation/examples for -
worker::Error
which by default causes an error response of some sort with an HTML body. If I were developing a REST API with JSON responses what would be the cleanest way to convert my errors to the appropriate JSON responses with a unique error code ?I hope my message doesn't come of as too aggressive. I realize that Rust support is in very early stages and would be happy to contribute to this crates code / documentation / examples etc.
Beta Was this translation helpful? Give feedback.
All reactions