I'm running two applications locally.
One is a Typescript front end application which has a Java/Spring Boot API. In this application I'm trying to do a GET on a URL in another separate application. It's a much older web application written in Java/JSP. This GET gives me the following error:
Access to XMLHttpRequest at 'http://localhost:8090/item/reissue.htm?id=123&customerNumber=456' from origin 'http://localhost:3000' 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.
If I do a GET with the same URL using Postman I get the expected response.
I've been trying to figure out how to get past this. This post suggests I must add a "Access-Control-Allow-Origin": "*" header. I tried adding this in my GET on the front end application but it makes no difference. Should it be added to the response or if this isn't the correct solution how do I resolve this issue?