const url = '{{url}}';
const adminP = '{{adminP}}';
const adminPW = '{{adminPW}}';
fetch(url)
.then(res => res.json())
.then(data => {
}).catch(err => {
console.error('Error: ', err);
});
const createNode = (elem) => {
return document.createElement(elem);
};
const appendNode = (parent, elem) => {
parent.appendChild(elem);
}
.then(data => {
data.map((responseD) => {
let li = createNode('li'),
img = createNode('img'),
span = createNode('span');
img.src = user.avatar_url;
span.innerText = user.login;
appendNode(li, img);
appendNode(li, span);
appendNode(ul, li);
});
})