I'm trying to get data from a local json file using axios. Under the console I can't even get a response so I figured I'd ask about it here.
.js file:
var loadData;
function loadData() {
axios({
url: "[filepath]/json/docs.json",
responseType: 'json',
credentials: "include",
mode: "no-cors",
headers: {
"Accept": "application/json; odata=verbose"
}
}).then((response) => {
console.log(response.data);
})
}
On the .then((response) line it's telling me I have a syntax error---I think it's pertaining to the response syntax but I'm not so sure. Any thoughts?