-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added CORS helper w tests #191
base: main
Are you sure you want to change the base?
Conversation
a889ba6
to
e5b9e88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops never submitted comments. lgtm and we can iterate going forward. I cut a PR exploring composition over inheritance (didn't update tests, so it's not ready to merge atm though)
What's the plan for things like credentials?
|
||
```typescript | ||
import { getFact } from "./myHttpApi"; | ||
import { corsHttpRouter } from "./helpers/corsHttpRouter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { corsHttpRouter } from "./helpers/corsHttpRouter"; | |
import { corsHttpRouter } from "convex-helpers/server/corsHttpRouter"; |
@@ -772,3 +773,138 @@ import { useQuery } from "convex-helpers/react/cache/hooks"; | |||
|
|||
const users = useQuery(api.users.getAll); | |||
``` | |||
|
|||
## HttpRouter with automatic CORS support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is long enough that we can just make this the stack article and have a short paragraph, code snippet, and link to that stack post here.
This added the CORS HttpRouter helper to the package. It includes tests and example usage, and README updates.