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

CORS Policy Blocked #99

Open
KerolosYoussef opened this issue Nov 26, 2022 · 4 comments
Open

CORS Policy Blocked #99

KerolosYoussef opened this issue Nov 26, 2022 · 4 comments

Comments

@KerolosYoussef
Copy link

'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Hello, I got this error message and i think you didn't enable the CORS in your server.

@rezarahiminia
Copy link
Owner

You cannot call the service directly
You can use SSR

@arwinsf
Copy link
Contributor

arwinsf commented Nov 26, 2022

By port 4200 I guess you are using Angular :D you can set up a proxy in Angular so that you won't get CORS errors and still contact the API.

@KerolosYoussef
Copy link
Author

By port 4200 I guess you are using Angular :D you can set up a proxy in Angular so that you won't get CORS errors and still contact the API.

Yeah i'm using angular. I have tried to use proxy but it didn't work idk why

@dcardonac31
Copy link

Hey @KerolosYoussef , you try develop a Api, in my Youtube channel I share a video, where I explain a Api rest with Nestjs: https://youtu.be/kc3VurqhiZw

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