corsHttpRouter
How can I get the code for the corsHttpRouter mentioned in this video?
https://youtu.be/c7Y0wCml1kg?si=PPh7IPR_04Lvudg1
Convex
YouTube
How to fix CORS errors for good
BLOCKED BY CORS
Did reading that give you shivers? You're not alone.
Cross origin resource sharing - CORS - has been a pain for developers for a long time. However, it is often made out to be more complex than needed, and solutions unnecessarily pedantic, when in reality you only need to remember a few things. Like, two things.
In this video,...
10 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!
I can't seem to find it in the GitHub repo mentioned in the description
Understanding CORS: A Developer's Guide
Cross-Origin Resource Sharing (CORS) is a crucial concept in modern web development, yet it's often misunderstood and can be a source of frustration f...
The PR stalled out: https://github.com/get-convex/convex-helpers/pull/191
Sorry we haven't followed up here, but the code is currently there. I have some lingering hopes for refactoring & supporting credentials configuration, which is why I've hesitated landing it as-is.
GitHub
Added CORS helper w tests by tomredman · Pull Request #191 · get-co...
This added the CORS HttpRouter helper to the package. It includes tests and example usage, and README updates.
Tom Redman isn't working at Convex anymore, but I'm chatting with another engineer about approaches so hopefully it can land in earnest.
Are you referring to supporting authentication via the JWT token when you say credentials ?
I’m trying to see if this is in a state to be used, cause I really need this asap 😭
I'm specifically referring to configuring how it handles specifying this header, and the implications on other configs when doing so: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
MDN Web Docs
Access-Control-Allow-Credentials - HTTP | MDN
The HTTP Access-Control-Allow-Credentials response header tells browsers whether the server allows credentials to be included in cross-origin HTTP requests.
how soon is ASAP? I could get you a fast version to work with (with an alpha release) but then maybe need to make some breaking changes.
@nikhildhoka I published it in
convex-helpers@0.1.67-alpha.0
Once I get another pair of eyes to sanity check the CORS spec I'll publish it in the next patch releaseOkay sounds good, thank you so much, I’ll take a look
Shipped in
convex-helpers@0.1.67
https://www.npmjs.com/package/convex-helpers#cors-support-for-httprouternpm
convex-helpers
A collection of useful code to complement the official convex package.. Latest version: 0.1.67, last published: 2 hours ago. Start using convex-helpers in your project by running
npm i convex-helpers
. There are 3 other projects in the npm registry using convex-helpers.