function getLast() { const url = `http://localhost:3000/vnosi`; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: "*", limit: 4 }) }) .then(response => response.json()) .then(data => { if (!data.success) { console.error('API Error:', data.message); return; } for (let entry of data.data) { let build = `

${entry.kljuc}

${entry.tip}

${entry.vsebina}

${entry.primer}

`; document.getElementById("entry-container").innerHTML += build; } }) .catch((error) => { console.error('Error:', error); }); } getLast();