Setting CORs is typically done on the Server side. Basically the server is saying “I do not know who this client is requesting data”
It’s because the API you’re trying to reach doesn’t support localhost.
We have a dedicated section in our docs on CORs and list some options you can take.