Update index.js
Browse files389 unmodified lines39039139239339439439539639739810 unmodified lines40941041141141241341241341441541641741841942042142242342442542642742842949 unmodified lines479480481482483484485389 unmodified linesapp.use(express.json());
const v8 = require('v8');const start = Date.now(); // Mulai menghitung waktu
app.all('/', (req, res) => { app.all('/', async (req, res) => { const status = {} status['diskUsage'] = cp.execSync('du -sh').toString().split('M')[0] + ' MB' 10 unmodified lines // Menambahkan semua properti dan metode dari v8 for (let x in v8) { if (typeof v8[x] === 'function') { status[x] = v8[x] } else { if (typeof v8[x] !== 'function') { status[x] = v8[x] } } const host = 'https://' + req.get('host'); const end = Date.now(); // Selesai menghitung waktu const latency = (end - start).toFixed(4) + ' ms'; // Menghitung latency
res.json({ creator: `@${process.env['SPACE_AUTHOR_NAME'] || 'ALOK FF'}`, message: 'Hello World!', uptime: new Date(process.uptime() * 1000).toUTCString().split(' ')[4], status, latency, // Menambahkan latency ke JSON "list": [ { "title": "BING AI",49 unmodified lines });});
app.get('/yt', async (req, res) => { const host = 'https://' + req.get('host'); try {index.js+8-4