-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
36 lines (32 loc) · 857 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!-- report-action -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Folder Listing</title>
</head>
<body>
<div id="app">
<ul id="links"></ul>
</div>
<script>
const linksList = document.getElementById('links')
fetch(`./data.json?t=${Date.now()}`)
.then((response) => response.ok && response.json())
.then((json) => {
if (!json) {
return
}
json.links.forEach((record) => {
const link = document.createElement('a')
link.appendChild(document.createTextNode(record))
link.href = record
const li = document.createElement('li')
li.appendChild(link)
linksList.appendChild(li)
})
delete json.links
})
</script>
</body>
</html>