Hey, sorry if this question sounds dumb but I’ve already spent days trying to figure this supposedly simple thing out on my own from the documentation/google.
I have a very basic, static React.js app that doesn’t have a Node server and sits on Netlify.
What I want is to fetch all the issues currently assigned to me, using a search query such as this:
https://dorightnow.atlassian.net/rest/api/2/search?jql=assignee=currentuser()
I have been trying this one with and without the Authorization header, but getting blocked by Cors ‘Access-Control-Allow-Origin’.
axios
.get(
"https://dorightnow.atlassian.net/rest/api/2/search?jql=assignee=currentuser()",
{
headers: {
Authorization: `Basic ${Buffer.from(`${API_USER}:${API_KEY}`).toString(
"base64"
)}`,
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET,PUT,POST,DELETE,PATCH,OPTIONS",
},
}
)
.then((res) => {
console.log(res);
});
What solutions are there (if any) if I do not want to run an express server behind my app?
Kind regards,
d.