File size: 1,640 Bytes
cd324a1 868077d 688cf8b 868077d 688cf8b 868077d cd324a1 |
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
const express = require('express')
const fs = require('fs')
const path = require('path')
const app = express()
app.get('/', (req, res) => {
const dir = path.join(__dirname, 'dl')
fs.readdir(dir, (err, files) => {
if (err) return res.send('Gagal baca folder')
const links = files.map(f => `
<div class="item">
<div class="icon">⬇️</div>
<a href="/dl/${f}" download>${f}</a>
</div>`).join('')
res.send(`
<html>
<head>
<title>GVR Download</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #121212;
color: #ffa500;
font-family: sans-serif;
padding: 20px;
}
h1 {
color: #ff8800;
margin-bottom: 20px;
}
.item {
display: flex;
align-items: center;
margin-bottom: 10px;
background: #1e1e1e;
padding: 10px;
border-radius: 10px;
}
.icon {
font-size: 24px;
margin-right: 10px;
}
a {
color: #ffa500;
text-decoration: none;
font-size: 16px;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>GVR Download</h1>
<p>Semua versi ada disini, maaf jika ada kesalahan.</p>
<hr>
${links}
</body>
</html>
`)
})
})
app.use('/dl', express.static(path.join(__dirname, 'dl')))
app.listen(7860) |