fetch('./server.json')
.then(response => response.json())
.then(data => console.log(data))
.catch(err => console.error(err));
const todoUrl ='https://jsonplaceholder.typicode.com/todos';
function getAllTodos(){
return new Promise((resolve => {
fetch(new Request(todoUrl)).
then( res => {
return res.json();
})
.then(data => {resolve(data);
});
}))
}