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

Add an escape hatch to register an arbitrary route handler #88

Open
jbearer opened this issue Nov 17, 2022 · 0 comments
Open

Add an escape hatch to register an arbitrary route handler #88

jbearer opened this issue Nov 17, 2022 · 0 comments

Comments

@jbearer
Copy link
Member

jbearer commented Nov 17, 2022

We should have something like api.raw(route_name, handler) where handler: (RequestParams, &State) -> Response, allowing the handler to build a response arbitrarily. This could be a simple wrapper around tide::ResponseBuilder. Example use cases:

  • a route that always returns binary data (Vec<u8>) without having to go through the extra step of bincode serializing that data
  • a Prometheus route
  • non-RESTful routes in general
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

1 participant