#CORS blocking API calls

21 messages · Page 1 of 1 (latest)

blazing haven
#

My Angular Project can not get any Data from my API (a NestJS Backend where CORS should be enabled). I tryed doin a Proxy.config.json file and adding it to the angular.json but it did not work like all other approches i tryed. My frontend and Backend are served in a Docker Container and you can see my source code here (newest branch selected): https://github.com/FreakeyPlays/vs-lab/tree/feature-13

GitHub

This Todo App was made in the Distributed and Parallel systems course at HS-Esslingen. - GitHub - FreakeyPlays/vs-lab at feature-13

blazing haven
#

My Console Output:

#

And the Headers of a Request:

visual sleet
#

Read the error message, the problem is not about cors. You are providing a string, not a URL. The message explains the expected formats

blazing haven
#

No it still is cors i jsut tryed different url to connect to my container

blazing haven
#

i mean i can try it aigan but evrytime it showed this error

#

one second

visual sleet
#

It's detected as a cors issue as you are trying to access another domain. But that's about the url format here, not the origin itself

blazing haven
#

oh okay

visual sleet
#

Not 500 but 5000 based on previous screenshot

blazing haven
#

now i get this

visual sleet
#

Are you sure it's on port 5000?

blazing haven
#

i get a bit confused with the ports while using Docker. Inside my docker i have the port 5000 and when i run my docker compose i map the outsoide Port of 8081 to 5000

#

do i need to use the 8081

#

i thought because i have them connected via a bridge that i need to use the inside ports

#

oh man... i think i needed to use the Outsideport

#

im so sorry this was a stupid help post

#

i should have found this out