Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Added CORS helper w tests #191

wants to merge 1 commit into from

Conversation

tomredman
Copy link

This added the CORS HttpRouter helper to the package. It includes tests and example usage, and README updates.

Copy link
Collaborator

@ianmacartney ianmacartney left a 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";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants