How can i use built-in Convex HTTP router, with pull zone from a CDN?
Hey š
Issue
I'm attempting to set up a pull zone to retrieve data from an HTTP action endpoint using the standard Convex HTTP router, but encountering difficulties with dynamic endpoints.
Details
While I successfully implemented this using the Hono adapter from convex-helpers package (which supports dynamic endpoints like ā app.use("images/:storageId")), I'm struggling to achieve the same functionality with the built-in Convex HTTP router, which i for several reasons would much prefer using.
Technical Context
1. The Hono adapter provides support for dynamic routes/slug routes (e.g., ā images/:storageId) which appears to be critical for my pull zone implementation, and how BunnyCDN handles the origin and the urls forwarded to that, when hitting the CDN.
2. I've also tried pointing the pull zone origin at a fixed files endpoint like ā
https://******.convex.cloud/api/storage
but encountered issues with the response format, maybe because it ain't returning a blob response like what i did with my hono implementation.
Id love some advice from the team or anyone else, on whether it's possible to implement dynamic endpoints with the standard HTTP router (seems not) or if there are any other ways to achieve this.
This is the hono implementation that worked (which id love to achieve with the built-in convex http router)
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
We are having the exact same issue, did you find a fix?