mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-14 08:50:31 +00:00
14 lines
315 B
JavaScript
14 lines
315 B
JavaScript
import { cpu, drive, mem, netstat } from "node-os-utils";
|
|
|
|
export default async function handler(req, res) {
|
|
const { disk } = req.query;
|
|
|
|
res.send({
|
|
cpu: {
|
|
usage: await cpu.usage(),
|
|
load: cpu.loadavgTime(5),
|
|
},
|
|
drive: await drive.info(disk || "/"),
|
|
memory: await mem.info(),
|
|
});
|
|
}
|