How can I read local JSON file with fetch function in javascript?
I have JSON file with some dump data and one function which read JSON file on server.
For example :
// Replace ./data.json with your JSON feed
fetch('./data.json').then(response => {
return response.json();
}).then(data => {
// Work with JSON data here
console.log(data);
}).catch(err => {
// Do something for an error here
});