Replies: 2 comments 3 replies
-
Hey, yes! This is definitely something I plan to support. Escape hatches like this will be very important for complex routes like the one you provided. It was originally on the todo list for v0.1 but got bumped.
This is exactly what I had in mind 😄 One of the beautiful thing about generating code is you get a lot more flexibility in what kinds of APIs you can provide. One thing I'd like to keep just for consistency is the order. While it would be possible to also support
I'm assuming this was a moot point about custom routes? Either way, this one is still on the list. I'm not planning to make it quite as powerful as the routing you'd find in Rails/Laravel, it'll probably be more like Netlify's _redirects file. This way you can statically analyze it.
You should be able to do Sidenote: I'd like to rename |
Beta Was this translation helpful? Give feedback.
-
@matthewmueller > Sidenote: I'd like to rename bud new controller ... to something else. I copied Rails on this one, but I find it strange that Just throwing this idea out there. What about: |
Beta Was this translation helpful? Give feedback.
-
I'm converting an app that handles GitHub webhooks, which requires access to some lower-level things:
X-GitHub-Event
,X-GitHub-Delivery
, andX-Hub-Signature-256
headers[]byte
orio.Reader
so I can validate the request signatureThe most convenient thing for me would be to have direct access to the
*http.Request
so that I can use common interfaces likegithub.ValidatePayload
.Would this be considered in scope of this project? If so I'd be happy to submit a PR if you have an idea for how it should work.
Here's a strawman proposal: if an action matches
http.HandlerFunc
, just call it directly.This would also provide a path forward for SSE/WebSocket endpoints, though maybe you've got your own plans for that.
This is definitely a bit of an "escape hatch" so I'd understand if you want to think on it for a while.
Sub-topic: custom routes
I see custom routes are mentioned here: #112 (comment) - so I'll add this use case as a data point.
edit: eh, this is turned out to kind of a moot point and I had a lot of wrong/mistaken info so I just removed it to keep the conversation more focused. The tl;dr is I currently handle webhooks at
/api/github/hook
which isn't a CRUD route at all. I can change this to/integrations/github/events
usingbud new integrations-events
(did I miss docs for this?) which seems better anyway. It'd be nice to separate API routes from web UI routes under/api
though, and I'm curious whether custom routes will ever be supported in general. It'd be nice for maintaining backwards compatibility for apps migrating to Bud, but it's not a huge deal to me personally. I understand it may not be worth butting heads with the framework too much.Beta Was this translation helpful? Give feedback.
All reactions