Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I configure CORS. I see that @tinyhttp/cors is a dependency of JSON-Server #1504

Open
kevincam3 opened this issue Jan 27, 2024 · 7 comments

Comments

@kevincam3
Copy link

How can I configure CORS?

@typicode
Copy link
Owner

CORS is enabled for all routes by default. There should be not need to configure it.

@kevincam3
Copy link
Author

Unfortunately it's not.
image

@typicode
Copy link
Owner

I'll have a look, thanks for the report

@kevincam3
Copy link
Author

Also just so you have a little background. I'm using Sentry.io and it adds some headers to do browser tracing and it's when it adds these headers that I get the CORS error. Thanks.

@acolesnic-stefanini
Copy link

Any news on this issue? I get the same CORS.
I am using just React with Vite and "json-server": "^1.0.0-alpha.23"

@acolesnic-stefanini
Copy link

The issue is only with alpha releases. i downgraded to version 0.17.4 and indeed CORS is enabled out of the box.

@rquispeq
Copy link

The issue is only with alpha releases. i downgraded to version 0.17.4 and indeed CORS is enabled out of the box.

I love you bro, I had the same problem too and it works downgraded the dependency.

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

No branches or pull requests

4 participants