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

COR issue #62

Open
savethehousemouse opened this issue Dec 15, 2019 · 1 comment
Open

COR issue #62

savethehousemouse opened this issue Dec 15, 2019 · 1 comment

Comments

@savethehousemouse
Copy link

Using the example chat unchanged I receive a
"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://file/socket.io/?EIO=3&transport=polling&t=My7DERo. (Reason: CORS request did not succeed)."

message. Looking around for enabling CORS I found a few tips like:
app.options('*', cors()) // include before other routes
app.use(cors({origin: 'http://localhost:3000', }));

but I do not see where and how I can enable it in this app.

It would be great if you would COR enable the example app since it would make the example work again and I could learn how to use the solution in my app based on your example.

Thank you in advance
g strubinsky

@Kothapalliprakash
Copy link

Kothapalliprakash commented Jun 9, 2024

app.use(cors({
origin: " * "
}));
app.options(' * ', cors());

I don't know whether you resolved this error or not. But, I overcame this issue by doing this.

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

2 participants