rezarahiminia / free-api-worldcup2022

Grab your football API data for FIFA World Cup 2022 competition!
239 stars 35 forks source link

CORS Policy Blocked #99

Open KerolosYoussef opened 1 year ago

KerolosYoussef commented 1 year ago

'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 commented 1 year ago

You cannot call the service directly You can use SSR

arwinsf commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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