2

I'm calling my backend (multiple microservices) inside my Angluar SPA and I'm getting this error:

enter image description here

As you see, there is a response (so the request aimed to the right path ect.) but the browser seems to block it.

My interpretation of this is the following:
The frontend would require the reponse to have a Access-Control-Allow-Origin header set. Because this header is not set, the response is blocked by the browser. So I need to adjust the CORS config of my backend to set this header.

Am I right?

I mentioned that the backend consists of multiple microservices to avoid answers that suggest a proxy config on angular side. As I understood it, this won't be possible for dynamic addresses of the microservices.

3
  • There isn't anything the client application can do about these errors. The server must be configured to accept the application's requests. Read about how to enable CORS for specific servers at enable-cors.org. Commented Jun 5, 2023 at 11:01
  • @Vikas I thought the response of the server being existent means that the request was accepted and the error occurs on the client side? Commented Jun 5, 2023 at 11:20
  • 1
    @AxelHerrmann You're interpretation is correct. Commented Jun 5, 2023 at 16:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.