const url = 'http://localhost:8000/employees' function getData() { return fetch(url) .then(response => response.json()) .then(result => { console.log(result) }) .catch(err => { console.log('Hiba:', err) }) } async function getData2() { try { const response = await fetch(url) const result = await response.json() console.log(result) }catch(err) { console.log('Hiba:', err) } } getData2()