I am trying to output an ordered list using axios get and update that call every 60 seconds. However, I am unable to figure out how to output more than one item using a template literal. Only the last item in the array is outputting to HTML. How do I output all items in the array to the ordered list.
https://codepen.io/zepzia/pen/YzPMLLK
<ol id="list"></ol>
const apiOne = 'https://jsonplaceholder.typicode.com/posts';
const list = document.querySelector('#list');
const apiCall = () => {
axios.get(apiOne)
.then(resp => {
resp.data.forEach(item => {
let output = `<li class="item">${item.title} - ${item.id}</li>`;
list.innerHTML = output;
})
})
}
apiCall();
setInterval(() => apiCall(), 60000)