mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
⬇️ Downgrade NextJS and React
Middleware didn't work in v12.2.3. Hopefully the password protection will work again now.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
import si from 'systeminformation';
|
||||
|
||||
async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
const [osInfo, cpuInfo, memInfo, cpuLoad] = await Promise.all([
|
||||
si.osInfo(),
|
||||
si.cpu(),
|
||||
si.mem(),
|
||||
si.currentLoad(),
|
||||
]);
|
||||
|
||||
const sysinfo = {
|
||||
cpu: cpuInfo,
|
||||
os: osInfo,
|
||||
mem: memInfo,
|
||||
load: cpuLoad,
|
||||
};
|
||||
res.status(200).json(sysinfo);
|
||||
}
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
// Filter out if the reuqest is a POST or a GET
|
||||
if (req.method === 'GET') {
|
||||
return Get(req, res);
|
||||
}
|
||||
return res.status(405).json({
|
||||
statusCode: 405,
|
||||
message: 'Method not allowed',
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user