Revert "cleanup v2"

This reverts commit 8b82578809.
This commit is contained in:
headlesdev
2025-05-17 12:31:27 +02:00
parent 8b82578809
commit 94ba5e20c6
318 changed files with 54608 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { NextResponse, NextRequest } from "next/server";
import { prisma } from "@/lib/prisma";
export async function POST(request: NextRequest) {
try {
const serverCountNoVMs = await prisma.server.count({
where: {
hostServer: 0
}
});
const serverCountOnlyVMs = await prisma.server.count({
where: {
hostServer: {
not: 0
}
}
});
const applicationCount = await prisma.application.count();
const onlineApplicationsCount = await prisma.application.count({
where: { online: true }
});
return NextResponse.json({
serverCountNoVMs,
serverCountOnlyVMs,
applicationCount,
onlineApplicationsCount
});
} catch (error: any) {
return NextResponse.json({ error: error.message }, { status: 500 });
}
}