Add uptime to resources widget

This commit is contained in:
shamoon 2023-03-05 14:57:20 -08:00
parent f46addf20a
commit b51af4377f
4 changed files with 76 additions and 1 deletions

View file

@ -41,6 +41,13 @@ export default async function handler(req, res) {
});
}
if (type === "uptime") {
const timeData = await si.time();
return res.status(200).json({
uptime: timeData.uptime
});
}
return res.status(400).json({
error: "invalid type",
});