Want via Ajax request to JSON file groups, which is in the project. That is, locally. But the catch is triggered. Still can't understand why and how to fix it
error: Error: Request failed with status code 404 at createError (createError.js:16) at settle (settle.js:18) at XMLHttpRequest.handleLoad (xhr.js:77)
fetch( 'src/rest/groups.json', { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' } } ).then(response => { console.log('resp: ', response); return responce.json(); }).then(resp => { console.log('resp: ', resp); });
or the same but using axios
axios({ method: 'GET', url: 'http://localhost:3000/rest/groups.json' }).then(resp => { console.log(resp); }).catch(e => { console.error('error: ', e); });