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

Trying to use the demo but keeps showing CORS error #3

Closed
freenetbrasil opened this issue Sep 26, 2019 · 3 comments
Closed

Trying to use the demo but keeps showing CORS error #3

freenetbrasil opened this issue Sep 26, 2019 · 3 comments

Comments

@freenetbrasil
Copy link

Hi, downloaded the demo and provided the credentials, after running:

npm install
npm run dev

The server now listens on port 5000

So far, so good. When I access the site it shows up fine but when trying to login, I keep getting:

POST https://api.cometchat.com/v1.8/users/superhero1/auth_tokens 500
localhost/:1 Access to fetch at 'https://api.cometchat.com/v1.8/users/superhero1/auth_tokens' from origin 'http://localhost:5000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Any ideas?

@ranjanravi85
Copy link

Hello @freenetbrasil,

Please try to run on https://localhost:5000, and you will not get that error, let us know if that solves your issue.

@freenetbrasil
Copy link
Author

No luck, it seems it's not listening on https on port 5000, just http.

@ranjanravi85
Copy link

Try running following command for https:-

npm run sdev

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

No branches or pull requests

2 participants