const URL = "url";
const key = "abc-abc-abc";
const getData = async () => {
const res = await fetch(URL, {
method: "GET",
headers: {
"X-Auth-Token": key,
"Access-Control-Allow-Origin": "*",
},
});
console.log(await res.json());
};
getData();
I am getting the errors -> GET url 401 -> Uncaught (in promise) SyntaxError: Unexpected end of input const res = await fetch(URL, { at getData()