Problem using the admin api to fetch the data in front-end

I want to fetch the data from the admin api for my front end. I tried to use the api in node js and it works but when i call it in the front end it gives me the following error " 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." i tried to add the following headers for the request. I am using axios to fetch the data

‘Access-Control-Allow-Origin’ : ‘*’,

‘Access-Control-Allow-Credentials’:true,

any help will be much appreciated.