How to enable cors to allow access to Rancher 2 api

I am having some issues accessing the rancher 2 API through a web application that I am creating, When I try and access the API I am getting CORS errors. I am trying to enable cors using an ingress service but I am not sure what use as the backend service.