/** * @file host.js * @description `GET /api/host` — the Administration page's Server tab: the * machine's hardware, load and disks, and each AgentHub user's share of its * CPU and memory right now (server/lib/host-stats.js). Read-only; staff only * in server mode (`/host` is in STAFF_ONLY_PREFIXES, server/lib/auth.js). * @author Nguyễn Ngọc Trí Vĩ */ const { Router } = require("express"); const { hostStats } = require("../lib/host-stats"); const router = Router(); router.get("/", async (_req, res) => { try { res.json(await hostStats()); } catch (e) { res.status(500).json({ error: { code: "EHOST", message: e.message } }); } }); module.exports = router;